This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@uphold/opentelemetry-connect-node
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@uphold/opentelemetry-connect-node

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

Installation

npm install @uphold/opentelemetry-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-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:

Options Type Description
ignoreRequest IgnoreRequestMatcher The instrumentation will not trace any requests return true from the function.
metadataToSpanAttributes MetadataToSpanAttributes List 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.

Package Sidebar

Install

npm i @uphold/opentelemetry-connect-node

Weekly Downloads

6

Version

0.1.0

License

MIT

Unpacked Size

45.8 kB

Total Files

27

Last publish

Collaborators

  • botatuphold
  • fixe
  • ruimarinho