@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.
- package/libs/index.mjs +6 -18
- 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.
|
|
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
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
new
|
|
121
|
-
|
|
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
|
],
|