@saidsef/tracing-node 3.3.5 → 3.3.7

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: "service-name"
37
+ revision: "fix-trace-resources"
package/libs/index.mjs CHANGED
@@ -31,7 +31,8 @@ import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc';
31
31
  import {PinoInstrumentation} from '@opentelemetry/instrumentation-pino';
32
32
  import {IORedisInstrumentation} from '@opentelemetry/instrumentation-ioredis';
33
33
  import {registerInstrumentations} from '@opentelemetry/instrumentation';
34
- import {defaultServiceName} from '@opentelemetry/resources';
34
+ import {Resource} from '@opentelemetry/resources';
35
+ import {ATTR_SERVICE_NAME} from '@opentelemetry/semantic-conventions';
35
36
 
36
37
  diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
37
38
 
@@ -43,12 +44,8 @@ diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
43
44
  * tracing for HTTP, Express, AWS, Pino, and DNS.
44
45
  *
45
46
  * @param {Object} options - Configuration options for tracing.
46
- * @param {string} [options.containerName=process.env.CONTAINER_NAME] - The name of the container.
47
- * @param {string} [options.deploymentEnvironment=process.env.NODE_ENV] - The deployment environment.
48
47
  * @param {string} [options.hostname=process.env.HOSTNAME] - The hostname of the service.
49
48
  * @param {string} [options.serviceName=process.env.SERVICE_NAME] - The name of the service.
50
- * @param {string} [options.serviceNameSpace=process.env.NAME_SPACE || 'default'] - The namespace of the service.
51
- * @param {string} [options.serviceVersion=process.env.SERVICE_VERSION || '0.0.0'] - The version of the service.
52
49
  * @param {string} [options.url=process.env.ENDPOINT] - The endpoint URL for the tracing collector.
53
50
  * @param {number} [options.concurrencyLimit=10] - The concurrency limit for the exporter.
54
51
  *
@@ -76,7 +73,9 @@ export function setupTracing(options = {}) {
76
73
 
77
74
  tracerProvider = new NodeTracerProvider({
78
75
  spanProcessors: [spanProcessor],
79
- resource: new defaultServiceName(),
76
+ resource: new Resource({
77
+ [ATTR_SERVICE_NAME]: serviceName,
78
+ }),
80
79
  });
81
80
 
82
81
  // Initialize the tracer provider with propagators
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidsef/tracing-node",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "description": "tracing NodeJS - Wrapper for OpenTelemetry instrumentation packages",
5
5
  "main": "libs/index.mjs",
6
6
  "scripts": {
@@ -42,7 +42,7 @@
42
42
  "@opentelemetry/instrumentation-ioredis": "^0.48.0",
43
43
  "@opentelemetry/instrumentation-pino": "^0.47.0",
44
44
  "@opentelemetry/propagator-b3": "^2.0.0",
45
- "@opentelemetry/resources": "^2.0.0",
45
+ "@opentelemetry/resources": "^1.8.0",
46
46
  "@opentelemetry/sdk-trace-base": "^2.0.0",
47
47
  "@opentelemetry/sdk-trace-node": "^2.0.0",
48
48
  "@opentelemetry/semantic-conventions": "^1.28.0"