You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@uphold/opentelemetry-instrumentation-connect-node

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uphold/opentelemetry-instrumentation-connect-node

OpenTelemetry instrumentation for `@connectrpc/connect-node` RPC client and server

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
5.9K
18.77%
Maintainers
3
Weekly downloads
 
Created
Source

@uphold/opentelemetry-instrumentation-connect-node

OpenTelemetry instrumentation for @connectrpc/connect-node RPC client and server.

Installation

npm install @uphold/opentelemetry-instrumentation-connect-node

Supported versions

Usage

Enable the instrumentation offered by this package, like so:

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { ConnectNodeInstrumentation } = require('@uphold/opentelemetry-instrumentation-connect-node');

const provider = new NodeTracerProvider({
  spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]
});

provider.register();

registerInstrumentations({
  instrumentations: [new ConnectNodeInstrumentation()]
});

Instrumentation options

The instrumentation accepts the following configuration:

OptionsTypeDescription
ignoreRequestIgnoreRequestMatcherThe instrumentation will not trace any requests return true from the function.
metadataToSpanAttributesMetadataToSpanAttributesList of case insensitive metadata to convert to span attributes. Client and server (outgoing requests, incoming responses) metadata attributes will be converted to span attributes in the form of rpc.{rpc_system}{request/response}.metadata.metadata_key, e.g. rpc.grpc.response.metadata.date

Caveats

Non-unary requests will not be traced

Only unary requests will be traced. Server streaming, client streaming and bidirectional streaming are not supported due to a bug in context propagation for generator functions. Supposedly, there are workarounds but none of them worked. See https://github.com/open-telemetry/opentelemetry-js/issues/2951 and https://github.com/nodejs/node/issues/42237 for more details.

Tests

npm test

License

Licensed under MIT.

Keywords

opentelemetry

FAQs

Package last updated on 09 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts