@peopl-health/nexus 2.3.8 → 2.3.9
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.
|
@@ -4,7 +4,7 @@ const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
|
|
|
4
4
|
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
|
|
5
5
|
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
|
|
6
6
|
const { BatchSpanProcessor } = require('@opentelemetry/sdk-trace-node');
|
|
7
|
-
const { Resource } = require('@opentelemetry/resources');
|
|
7
|
+
const { detectResources, Resource } = require('@opentelemetry/resources');
|
|
8
8
|
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
|
|
9
9
|
|
|
10
10
|
class TelemetryManager {
|
|
@@ -30,11 +30,14 @@ class TelemetryManager {
|
|
|
30
30
|
} = config;
|
|
31
31
|
|
|
32
32
|
try {
|
|
33
|
-
//
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
// Detect resources and merge with service information (OTel v2.x)
|
|
34
|
+
const detectedResource = await detectResources();
|
|
35
|
+
const resource = detectedResource.merge(
|
|
36
|
+
new Resource({
|
|
37
|
+
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
|
|
38
|
+
[SemanticResourceAttributes.SERVICE_VERSION]: serviceVersion,
|
|
39
|
+
})
|
|
40
|
+
);
|
|
38
41
|
|
|
39
42
|
const prometheusExporter = new PrometheusExporter({
|
|
40
43
|
endpoint: prometheusEndpoint,
|