@saidsef/tracing-node 3.0.6 → 3.2.0

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.
@@ -34,4 +34,4 @@ spec:
34
34
  gitRepo:
35
35
  directory: "."
36
36
  repository: "https://github.com/saidsef/tracing-node.git"
37
- revision: "fix-repo-url"
37
+ revision: "redis-connect"
package/libs/index.mjs CHANGED
@@ -16,20 +16,22 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import {CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator} from '@opentelemetry/core';
20
- import {NodeTracerProvider} from '@opentelemetry/sdk-trace-node';
21
- import {BatchSpanProcessor} from '@opentelemetry/sdk-trace-base';
22
- import {registerInstrumentations} from '@opentelemetry/instrumentation';
23
- import {diag, DiagConsoleLogger, DiagLogLevel} from '@opentelemetry/api';
24
19
  import {AwsInstrumentation} from '@opentelemetry/instrumentation-aws-sdk';
25
- import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc';
26
20
  import {B3Propagator, B3InjectEncoding} from '@opentelemetry/propagator-b3';
21
+ import {BatchSpanProcessor} from '@opentelemetry/sdk-trace-base';
22
+ import {CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator} from '@opentelemetry/core';
23
+ import {ConnectInstrumentation} from '@opentelemetry/instrumentation-connect';
24
+ import {diag, DiagConsoleLogger, DiagLogLevel} from '@opentelemetry/api';
25
+ import {DnsInstrumentation} from '@opentelemetry/instrumentation-dns';
26
+ import {ExpressInstrumentation} from '@opentelemetry/instrumentation-express';
27
27
  import {HttpInstrumentation} from '@opentelemetry/instrumentation-http';
28
+ import {NodeTracerProvider} from '@opentelemetry/sdk-trace-node';
29
+ import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc';
30
+ import {PinoInstrumentation} from '@opentelemetry/instrumentation-pino';
31
+ import {RedisInstrumentation} from '@opentelemetry/instrumentation-redis';
32
+ import {registerInstrumentations} from '@opentelemetry/instrumentation';
28
33
  import {Resource} from '@opentelemetry/resources';
29
34
  import {SemanticResourceAttributes} from '@opentelemetry/semantic-conventions';
30
- import {ExpressInstrumentation} from '@opentelemetry/instrumentation-express';
31
- import {PinoInstrumentation} from '@opentelemetry/instrumentation-pino';
32
- import {DnsInstrumentation} from '@opentelemetry/instrumentation-dns';
33
35
 
34
36
  diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
35
37
 
@@ -100,7 +102,7 @@ export function setupTracing(options = {}) {
100
102
  // Register the span processor with the tracer provider
101
103
  const exporter = new OTLPTraceExporter(exportOptions);
102
104
  const spanProcessor = new BatchSpanProcessor(exporter);
103
- tracerProvider.addSpanProcessor(spanProcessor);
105
+ tracerProvider.spanProcessor(spanProcessor);
104
106
 
105
107
  // Ignore spans from static assets.
106
108
  const ignoreIncomingRequestHook = (req) => {
@@ -112,23 +114,13 @@ export function setupTracing(options = {}) {
112
114
  registerInstrumentations({
113
115
  tracerProvider: tracerProvider,
114
116
  instrumentations: [
115
- new ExpressInstrumentation({
116
- ignoreIncomingRequestHook,
117
- }),
118
- new PinoInstrumentation({
119
- logHook: (span, record) => {
120
- record['resource.service.name'] = tracerProvider.resource.attributes['service.name'];
121
- },
122
- }),
123
- new HttpInstrumentation({
124
- requireParentforOutgoingSpans: false,
125
- requireParentforIncomingSpans: false,
126
- ignoreIncomingRequestHook,
127
- }),
128
- new AwsInstrumentation({
129
- sqsExtractContextPropagationFromPayload: true,
130
- }),
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, }),
131
122
  new DnsInstrumentation(),
123
+ new RedisInstrumentation(),
132
124
  ],
133
125
  });
134
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidsef/tracing-node",
3
- "version": "3.0.6",
3
+ "version": "3.2.0",
4
4
  "description": "tracing NodeJS - This is a wrapper for OpenTelemetry instrumentation packages",
5
5
  "main": "libs/index.mjs",
6
6
  "scripts": {
@@ -34,10 +34,12 @@
34
34
  "@opentelemetry/exporter-trace-otlp-grpc": "^0.57.0",
35
35
  "@opentelemetry/instrumentation": "^0.57.0",
36
36
  "@opentelemetry/instrumentation-aws-sdk": "^0.49.0",
37
+ "@opentelemetry/instrumentation-connect": "^0.43.0",
37
38
  "@opentelemetry/instrumentation-dns": "^0.43.0",
38
39
  "@opentelemetry/instrumentation-express": "^0.47.0",
39
- "@opentelemetry/instrumentation-http": "^0.57.0",
40
+ "@opentelemetry/instrumentation-http": "^0.57.2",
40
41
  "@opentelemetry/instrumentation-pino": "^0.46.0",
42
+ "@opentelemetry/instrumentation-redis": "^0.46.0",
41
43
  "@opentelemetry/propagator-b3": "^1.28.0",
42
44
  "@opentelemetry/resources": "^1.28.0",
43
45
  "@opentelemetry/sdk-trace-base": "^1.28.0",