0.35.14 • Published 11 months ago

@codeparrot/instrumentation-grpc v0.35.14

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
11 months ago

OpenTelemetry gRPC Instrumentation for Node.js

NPM Published Version Apache License

Note: This is an experimental package under active development. New releases may include breaking changes.

This module provides automatic instrumentation for grpc and @grpc/grpc-js. Currently, version 1.x of grpc and version 1.x of @grpc/grpc-js is supported.

For automatic instrumentation see the @opentelemetry/sdk-trace-node package.

Installation

npm install --save @opentelemetry/instrumentation-grpc

Usage

OpenTelemetry gRPC Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with gRPC or (grpc-js).

To load a specific instrumentation (gRPC in this case), specify it in the Node Tracer's configuration.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { GrpcInstrumentation } = require('@opentelemetry/instrumentation-grpc');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const provider = new NodeTracerProvider();

provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.register();

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

See examples/grpc or examples/grpc-js for examples.

gRPC Instrumentation Options

gRPC instrumentation accepts the following configuration:

OptionsTypeDescription
ignoreGrpcMethodsIgnoreMatcher[]gRPC instrumentation will not trace any methods that match anything in this list. You may pass a string (case-insensitive match), a RegExp object, or a filter function.
metadataToSpanAttributesobjectList of case insensitive metadata to convert to span attributes. Client (outgoing requests, incoming responses) metadata attributes will be converted to span attributes in the form of rpc.{request\response}.metadata.metadata_key, e.g. rpc.response.metadata.date

Useful links

License

Apache 2.0 - See LICENSE for more information.

0.0.10002

11 months ago

0.35.14

11 months ago

0.35.11

1 year ago

0.35.12

1 year ago

0.35.10

1 year ago

0.35.5

1 year ago

0.35.9

1 year ago

0.35.8

1 year ago

0.35.13

12 months ago

0.35.7

1 year ago

0.35.6

1 year ago

0.35.4

1 year ago

0.35.3

1 year ago