This module provides automatic instrumentation for @google-cloud/pubsub
.
npm install --save @tommbee/opentelemetry-instrumentation-gcp-pubsub
Initiate this module as part of the instrumentations
config in your Open Telemetry set up: @opentelemetry/instrumentation
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GCPPubSubInstrumentation } = require('@tommbee/opentelemetry-instrumentation-gcp-pubsub');
registerInstrumentations({
tracerProvider,
instrumentations: [
new GCPPubSubInstrumentation({
subscriberSpanName: 'handle.subscription'
})
]
});
Options | Description |
---|---|
subscriberSpanName |
The name of the Span created to trace events received through a subscriber |