@saidsef/tracing-node 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/libs/index.mjs +6 -18
  2. package/package.json +1 -1
package/libs/index.mjs CHANGED
@@ -102,7 +102,7 @@ export function setupTracing(options = {}) {
102
102
  // Register the span processor with the tracer provider
103
103
  const exporter = new OTLPTraceExporter(exportOptions);
104
104
  const spanProcessor = new BatchSpanProcessor(exporter);
105
- tracerProvider.addSpanProcessor(spanProcessor);
105
+ tracerProvider.activeSpanProcessor(spanProcessor);
106
106
 
107
107
  // Ignore spans from static assets.
108
108
  const ignoreIncomingRequestHook = (req) => {
@@ -114,23 +114,11 @@ export function setupTracing(options = {}) {
114
114
  registerInstrumentations({
115
115
  tracerProvider: tracerProvider,
116
116
  instrumentations: [
117
- new ExpressInstrumentation({
118
- ignoreIncomingRequestHook,
119
- }),
120
- new PinoInstrumentation({
121
- logHook: (span, record) => {
122
- record['resource.service.name'] = tracerProvider.resource.attributes['service.name'];
123
- },
124
- }),
125
- new HttpInstrumentation({
126
- requireParentforOutgoingSpans: false,
127
- requireParentforIncomingSpans: false,
128
- ignoreIncomingRequestHook,
129
- }),
130
- new ConnectInstrumentation(),
131
- new AwsInstrumentation({
132
- sqsExtractContextPropagationFromPayload: true,
133
- }),
117
+ new PinoInstrumentation({ logHook: (span, record) => { record['resource.service.name'] = tracerProvider.resource.attributes['service.name']; }, }),
118
+ new HttpInstrumentation({ requireParentforOutgoingSpans: false, requireParentforIncomingSpans: false, ignoreIncomingRequestHook, }),
119
+ new ExpressInstrumentation({ ignoreIncomingRequestHook, }),
120
+ new ConnectInstrumentation(),
121
+ new AwsInstrumentation({ sqsExtractContextPropagationFromPayload: true, }),
134
122
  new DnsInstrumentation(),
135
123
  new RedisInstrumentation(),
136
124
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidsef/tracing-node",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "tracing NodeJS - This is a wrapper for OpenTelemetry instrumentation packages",
5
5
  "main": "libs/index.mjs",
6
6
  "scripts": {