pragmaticivan / nestjs-otel

OpenTelemetry (Tracing + Metrics) module for Nest framework (node.js) 🔭
Apache License 2.0
560 stars 48 forks source link

Error: Cannot read properties of undefined (reading 'getMeterProvider') since v5.0.0 #371

Open Djiit opened 1 year ago

Djiit commented 1 year ago

Hey,

When trying to upgrade to v5, I'm having this error:

TypeError: Cannot read properties of undefined (reading 'getMeterProvider')
    at getOrCreateObservableGauge (/Users/(...)/node_modules/nestjs-otel/src/metrics/metric-data.ts:79:25)
    at MetricService.getObservableGauge (/Users/(...)/node_modules/nestjs-otel/src/metrics/metric.service.ts:36:38)

Also got the same with getCounter.

Happy to help providing more info. Thanks

pragmaticivan commented 1 year ago

Hi, @Djiit Could you share the list of packages you are using right now? Otel JS SDK has updated a few interfaces in this version.

Djiit commented 1 year ago

Hi, sure, here are the related packages:

    "@opentelemetry/api": "^1.3.0",
    "@opentelemetry/auto-instrumentations-node": "^0.35.0",
    "@opentelemetry/auto-instrumentations-web": "^0.31.0",
    "@opentelemetry/context-async-hooks": "^1.8.0",
    "@opentelemetry/context-zone": "^1.8.0",
    "@opentelemetry/exporter-prometheus": "^0.34.0",
    "@opentelemetry/exporter-trace-otlp-http": "^0.34.0",
    "@opentelemetry/propagator-b3": "^1.8.0",
    "@opentelemetry/sdk-node": "^0.34.0",
    "@opentelemetry/sdk-trace-web": "^1.8.0",
github-actions[bot] commented 1 day ago

This issue was marked stale. It will be closed in 30 days without additional activity.