@avtechno/sfr 2.0.4 → 2.0.5
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.
|
@@ -9,7 +9,7 @@ import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentation
|
|
|
9
9
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
10
10
|
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
11
11
|
import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
12
|
-
import {
|
|
12
|
+
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
13
13
|
import otel_semantics from "@opentelemetry/semantic-conventions";
|
|
14
14
|
import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
|
|
15
15
|
import { init_metrics } from "./metrics.mjs";
|
|
@@ -75,7 +75,7 @@ export function init_observability(oas_cfg, options = {}) {
|
|
|
75
75
|
if (config.port) {
|
|
76
76
|
resource_attributes["sfr.port"] = String(config.port);
|
|
77
77
|
}
|
|
78
|
-
const resource =
|
|
78
|
+
const resource = resourceFromAttributes(resource_attributes);
|
|
79
79
|
// Configure exporters
|
|
80
80
|
const trace_exporter = new OTLPTraceExporter({
|
|
81
81
|
url: `${otlp_endpoint}/v1/traces`
|
|
@@ -98,7 +98,6 @@ export function init_observability(oas_cfg, options = {}) {
|
|
|
98
98
|
sdk = new NodeSDK({
|
|
99
99
|
resource,
|
|
100
100
|
traceExporter: trace_exporter,
|
|
101
|
-
// @ts-expect-error - Type mismatch between SDK packages, but compatible at runtime
|
|
102
101
|
metricReader: metric_reader,
|
|
103
102
|
instrumentations
|
|
104
103
|
});
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentation
|
|
|
10
10
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
11
11
|
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
12
12
|
import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
13
|
-
import { resourceFromAttributes
|
|
13
|
+
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
14
14
|
import otel_semantics from "@opentelemetry/semantic-conventions";
|
|
15
15
|
import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
|
|
16
16
|
|