question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package broken with newest opentelemetry dependencies

See original GitHub issue

When using the latest opentelementy packages (0.27.0), the Nest application fails to start with the following error:

/home/node/app/node_modules/nestjs-otel/src/metrics/metric-data.ts:27
      const valueRecorder = meter.createValueRecorder(name, options);
                                  ^
TypeError: meter.createValueRecorder is not a function
    at getOrCreateValueRecorder (/home/node/app/node_modules/nestjs-otel/src/metrics/metric-data.ts:27:35)
    at MetricService.getOrCreateValueRecorder (/home/node/app/node_modules/nestjs-otel/src/metrics/metric.service.ts:26:36)
    at MetricService.getValueRecorder (/home/node/app/node_modules/nestjs-otel/src/metrics/metric.service.ts:20:17)
    at new ApiMetricsMiddleware (/home/node/app/node_modules/nestjs-otel/src/middleware/api-metrics.middleware.ts:90:47)
    at Injector.instantiateClass (/home/node/app/node_modules/@nestjs/core/injector/injector.js:301:19)
    at callback (/home/node/app/node_modules/@nestjs/core/injector/injector.js:48:41)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Injector.resolveConstructorParams (/home/node/app/node_modules/@nestjs/core/injector/injector.js:124:24)
    at async Injector.loadInstance (/home/node/app/node_modules/@nestjs/core/injector/injector.js:52:9)
    at async Injector.loadMiddleware (/home/node/app/node_modules/@nestjs/core/injector/injector.js:61:9)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
brpazcommented, Jun 25, 2022

Hello. I am also getting this error:

opentelemetry-node-metrics@1.1.0/node_modules/opentelemetry-node-metrics/metrics/version.js:17
  }).bind(version).add(1)
     ^
TypeError: meter.createUpDownCounter(...).bind is not a function

From what I understood this was fixed here in the opentelemetry-node-metrics.. which is already the version on the main branch on this repo, but not in the latest released tag.

@pragmaticivan Any chance to create a new release please?

2reactions
pragmaticivancommented, Nov 22, 2021

That’s actually great news 😂 I will try to patch that up this weekend, It will require a major version though. I’ve been keeping track of this release for a while but some packages might be moved somewhere else FYI.

Ref: https://github.com/open-telemetry/opentelemetry-js/issues/2480

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenTelemetry for Java - Honeycomb Documentation
Acquire Dependencies. The auto-instrumentation agent for Honeycomb OpenTelemetry Java will automatically generate trace data from your application.
Read more >
@opentelemetry/core - npm
OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.. Latest version: 1.8.0, last published: 2 ...
Read more >
Versioning and stability for OpenTelemetry clients
Never create a dependency conflict between packages which rely on different versions of OpenTelemetry. Avoid breaking all stable public APIs.
Read more >
Getting started with OpenTelemetry and distributed tracing in ...
NET we must first create a new activity: ... The OpenTelemetry package is the core library. ... Instrument dependency calls.
Read more >
What is OpenTelemetry? | Lightstep Observability Learning ...
OpenTelemetry & Lightstep. Lightstep Observability supports OpenTelemetry as the way to get telemetry data (traces, logs, and metrics) from your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found