Registry / observability / skyeye-sdk-js

skyeye-sdk-js

JSON →
library1.4.25jsnpmunverified

A JavaScript/TypeScript SDK for sending traces and metrics to SkyEye via gRPC. Version 1.4.25 is current, with weekly releases. It provides a type-safe, promise-based client for streaming observability data, supporting both Node.js and browser environments. Differentiators include direct gRPC transport (vs HTTP), native TypeScript types, and low-level control over payloads.

npm install skyeye-sdk-js
INSTALL
IMPORT
SIG · SKYEYE-SDK-JS
S
skyeye-sdk-js
observabilityjavascriptv1.4.25
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SkyEyeClient
import { SkyEyeClient } from 'skyeye-sdk-js'
const SkyEyeClient = require('skyeye-sdk-js')
ESM-only since v1.0.0
TracePayload
import type { TracePayload } from 'skyeye-sdk-js'
import { TracePayload } from 'skyeye-sdk-js'
Use import type for TypeScript types to avoid runtime inclusion
sendTrace
import { sendTrace } from 'skyeye-sdk-js/client'
import { sendTrace } from 'skyeye-sdk-js'
sendTrace is a submodule export since v1.2.0
SkyEyeClient (default)
import SkyEyeClient from 'skyeye-sdk-js'
Default import aliases the named export for convenience

Shows how to create a client, send a trace, handle errors, and close the connection using environment variables for configuration.

import { SkyEyeClient } from 'skyeye-sdk-js'; const client = new SkyEyeClient({ endpoint: process.env.SKYEYE_ENDPOINT ?? 'localhost:4317', apiKey: process.env.SKYEYE_API_KEY ?? '', }); async function main() { try { await client.sendTrace({ traceId: 'abc123', spanId: 'def456', name: 'example-span', startTime: Date.now() * 1e6, // nanoseconds endTime: (Date.now() + 1000) * 1e6, attributes: { key: 'value' }, }); console.log('Trace sent successfully'); } catch (err) { console.error('Failed to send trace:', err); } finally { client.close(); } } main();
Debug
Known issues
breakingv1.0.0 replaced CommonJS require() with ESM imports. require('skyeye-sdk-js') throws ERR_REQUIRE_ESM.
fix
Use import syntax or upgrade to Node 14+ with 'type': 'module'.
affects: <1.0.0
deprecatedNamespaced exports like skyeye.metrics are deprecated in favor of direct imports from subpaths.
fix
Use import { sendMetric } from 'skyeye-sdk-js/client' instead.
affects: <1.2.0
gotchaTimestamps must be in nanoseconds (not milliseconds). Passing Date.now() results in silently incorrect data.
fix
Multiply milliseconds by 1e6: Date.now() * 1e6.
affects: >=0.0.0
gotchaThe close() method must be called to flush pending traces; otherwise data may be lost on process exit.
fix
Call client.close() in a finally block or use process.on('exit', ...).
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: skyeye_sdk_js_1.SkyEyeClient is not a constructor
Using default import with require() or incorrect import syntax
fix
Use import { SkyEyeClient } from 'skyeye-sdk-js'
Error: 14 UNAVAILABLE: failed to connect to all addresses
gRPC endpoint not reachable (wrong host/port or server not running)
fix
Verify SKYEYE_ENDPOINT env var matches the SkyEye collector address
TypeError: Cannot read properties of undefined (reading 'name')
Missing required fields in trace payload (e.g., name)
fix
Ensure trace object includes name, traceId, spanId, startTime, endTime
Upgrade
Version history
1.4.25latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredgRPC transport layer
protobufjsrequiredProtocol Buffers serialization
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
2
Resources
skyeye-sdk-js — npm install skyeye-sdk-js · libregistry