@saidsef/tracing-node 2.2.4 → 2.2.6
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/README.md +7 -2
- package/libs/index.mjs +15 -15
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# Opentelemetry Wrapper for Tracing Node Applications
|
|
2
2
|
|
|
3
|
-
[](#Instalation)
|
|
4
|
-
|
|
3
|
+
[](#Instalation)
|
|
4
|
+
[](#Instalation)
|
|
5
|
+

|
|
6
|
+
 
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
|
package/libs/index.mjs
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import {CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator} from '@opentelemetry/core';
|
|
20
|
-
import {registerInstrumentations} from '@opentelemetry/instrumentation';
|
|
21
20
|
import {NodeTracerProvider} from '@opentelemetry/sdk-trace-node';
|
|
22
21
|
import {BatchSpanProcessor} from '@opentelemetry/sdk-trace-base';
|
|
22
|
+
import {registerInstrumentations} from '@opentelemetry/instrumentation';
|
|
23
23
|
import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc';
|
|
24
24
|
import {HttpInstrumentation} from '@opentelemetry/instrumentation-http';
|
|
25
25
|
import {ExpressInstrumentation} from '@opentelemetry/instrumentation-express';
|
|
@@ -77,6 +77,12 @@ export function setupTracing (options={}) {
|
|
|
77
77
|
}),
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
// Initialize the tracer provider
|
|
81
|
+
provider.register({
|
|
82
|
+
propagator: new CompositePropagator({
|
|
83
|
+
propagators: [new W3CBaggagePropagator(), new W3CTraceContextPropagator(), new B3Propagator({injectEncoding: B3InjectEncoding.MULTI_HEADER})],
|
|
84
|
+
})});
|
|
85
|
+
|
|
80
86
|
// Configure exporter with the Collector endpoint - uses gRPC
|
|
81
87
|
const exportOptions = {
|
|
82
88
|
concurrencyLimit: concurrencyLimit,
|
|
@@ -97,32 +103,26 @@ export function setupTracing (options={}) {
|
|
|
97
103
|
registerInstrumentations({
|
|
98
104
|
tracerProvider: provider,
|
|
99
105
|
instrumentations: [
|
|
100
|
-
new HttpInstrumentation({
|
|
101
|
-
requireParentforOutgoingSpans: false,
|
|
102
|
-
requireParentforIncomingSpans: false,
|
|
103
|
-
ignoreIncomingRequestHook,
|
|
104
|
-
}),
|
|
105
106
|
new ExpressInstrumentation({
|
|
106
107
|
ignoreIncomingRequestHook,
|
|
107
108
|
}),
|
|
108
|
-
new AwsInstrumentation({
|
|
109
|
-
sqsExtractContextPropagationFromPayload: true
|
|
110
|
-
}),
|
|
111
109
|
new PinoInstrumentation({
|
|
112
110
|
logHook: (span, record) => {
|
|
113
111
|
record['resource.service.name'] = provider.resource.attributes['service.name'];
|
|
114
112
|
},
|
|
115
113
|
}),
|
|
114
|
+
new HttpInstrumentation({
|
|
115
|
+
requireParentforOutgoingSpans: false,
|
|
116
|
+
requireParentforIncomingSpans: false,
|
|
117
|
+
ignoreIncomingRequestHook,
|
|
118
|
+
}),
|
|
119
|
+
new AwsInstrumentation({
|
|
120
|
+
sqsExtractContextPropagationFromPayload: true
|
|
121
|
+
}),
|
|
116
122
|
new DnsInstrumentation(),
|
|
117
123
|
],
|
|
118
124
|
});
|
|
119
125
|
|
|
120
|
-
// Initialize the tracer provider
|
|
121
|
-
provider.register({
|
|
122
|
-
propagator: new CompositePropagator({
|
|
123
|
-
propagators: [new W3CBaggagePropagator(), new W3CTraceContextPropagator(), new B3Propagator({injectEncoding: B3InjectEncoding.MULTI_HEADER})],
|
|
124
|
-
})});
|
|
125
|
-
|
|
126
126
|
// Return the tracer for the service
|
|
127
127
|
return provider.getTracer(serviceName);
|
|
128
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saidsef/tracing-node",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "tracing NodeJS - This is a wrapper for OpenTelemetry instrumentation packages",
|
|
5
5
|
"main": "libs/index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"homepage": "https://github.com/saidsef/tracing-nodejs#readme",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@opentelemetry/api": "^1.9.0",
|
|
42
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
43
|
-
"@opentelemetry/instrumentation": "^0.
|
|
44
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
45
|
-
"@opentelemetry/instrumentation-dns": "^0.
|
|
46
|
-
"@opentelemetry/instrumentation-express": "^0.
|
|
47
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
48
|
-
"@opentelemetry/instrumentation-pino": "^0.
|
|
42
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.53.0",
|
|
43
|
+
"@opentelemetry/instrumentation": "^0.53.0",
|
|
44
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.44.0",
|
|
45
|
+
"@opentelemetry/instrumentation-dns": "^0.40.0",
|
|
46
|
+
"@opentelemetry/instrumentation-express": "^0.44.0",
|
|
47
|
+
"@opentelemetry/instrumentation-http": "^0.53.0",
|
|
48
|
+
"@opentelemetry/instrumentation-pino": "^0.43.0",
|
|
49
49
|
"@opentelemetry/propagator-b3": "^1.25.1",
|
|
50
|
-
"@opentelemetry/resources": "^1.
|
|
51
|
-
"@opentelemetry/sdk-trace-base": "^1.
|
|
52
|
-
"@opentelemetry/sdk-trace-node": "^1.
|
|
50
|
+
"@opentelemetry/resources": "^1.26.0",
|
|
51
|
+
"@opentelemetry/sdk-trace-base": "^1.26.0",
|
|
52
|
+
"@opentelemetry/sdk-trace-node": "^1.26.0",
|
|
53
53
|
"@opentelemetry/semantic-conventions": "^1.25.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|