File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
44import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-proto" ;
55import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-proto" ;
66import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics" ;
7- import { Resource } from "@opentelemetry/resources" ;
7+ import { resourceFromAttributes } from "@opentelemetry/resources" ;
88import { ATTR_SERVICE_NAME , ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions" ;
99
1010// Only initialize OpenTelemetry in production (unless OTEL_ENABLED is explicitly set to "true")
@@ -19,7 +19,7 @@ if (shouldEnableOtel) {
1919 const environment = process . env . NODE_ENV || "development" ;
2020
2121 // Create resource with service information
22- const resource = new Resource ( {
22+ const resource = resourceFromAttributes ( {
2323 [ ATTR_SERVICE_NAME ] : serviceName ,
2424 [ ATTR_SERVICE_VERSION ] : serviceVersion ,
2525 environment : environment , // Tag all data with environment
You can’t perform that action at this time.
0 commit comments