@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 { Resource } from "@opentelemetry/resources";
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 = new Resource(resource_attributes);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avtechno/sfr",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "An opinionated way of writing services using ExpressJS.",
5
5
  "type": "module",
6
6
  "files": [
@@ -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, type Resource } from "@opentelemetry/resources";
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