Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: bind is not a function #5

Closed
nirgn975 opened this issue Dec 30, 2021 · 4 comments
Closed

bug: bind is not a function #5

nirgn975 opened this issue Dec 30, 2021 · 4 comments

Comments

@nirgn975
Copy link

Describe the bug
Hi,
I use nestjs-otel latest version (3.0.0) which use this package latest version (1.1.0).
And sometimes (not every build) I got:

(node:48789) UnhandledPromiseRejectionWarning: TypeError: meter.createUpDownCounter(...).bind is not a function
    at module.exports (/Users/nir/cybereason/gateway/node_modules/opentelemetry-node-metrics/metrics/version.js:17:6)
    at setupNodeMetrics (/Users/nir/cybereason/gateway/node_modules/opentelemetry-node-metrics/index.js:18:31)
    at OpenTelemetryCoreModule.onApplicationBootstrap (/Users/nir/cybereason/gateway/node_modules/nestjs-otel/src/opentelemetry-core.module.ts:110:44)

I just keep saving changes and NestJS build the project, and sometimes I get this error and sometimes I don't (race conduction?)

To Reproduce
Just create a new NestJS project, and setup nestjs-otel.

Additional context

  • node.js version: v14.18.0
  • npm version: 8.0.0
  • macos
  • netsjs version 8.x.x
  • nestjs-otel version 3.0.0
  • opentelemetry-node-metrics version: 1.1.0
@marcbachmann
Copy link
Owner

Weird. Could it be that something gets initialized asynchonously there or in opentelemetry? This library just calls .getMeter() https://github.com/marcbachmann/opentelemetry-node-metrics/blob/master/index.js#L6

And uses the meter.createUpDownCounter in here
https://github.com/marcbachmann/opentelemetry-node-metrics/blob/master/metrics/version.js#L17

@weyert
Copy link

weyert commented Jan 6, 2022

The most recent api-metrics appears to have removed the bind-function. That's probably causing this issue

@marcbachmann
Copy link
Owner

@marcbachmann
Copy link
Owner

I've merged v2.0.0 that fixes this and dropped compatibility for <v0.27.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants