You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
1.0.0
What version of Node are you using?
v12.12.0
What did you do?
I was working through some basics examples of the metric API using plain javascript (i.e. not TypeScript), and I noticed that code that looks something like this
const counter = meter.createCounter('our-counter-metric', {
description: 'Example of a observer',
});
counter.add(1)
Ended up throwing an error like this
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Object.hashLabels (/path/to/opentel/node_modules/@opentelemetry/metrics/build/src/Utils.js:32:23)
at CounterMetric.bind (/path/to/opentel/node_modules/@opentelemetry/metrics/build/src/Metric.js:44:30)
at CounterMetric.add (/path/to/opentel/node_modules/@opentelemetry/metrics/build/src/Metric.js:102:14)
at /path/to/opentel/index.js:32:11
at Layer.handle [as handle_request] (/path/to/opentel/node_modules/express/lib/router/layer.js:95:5)
at next (/path/to/opentel/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/path/to/opentel/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/path/to/opentel/node_modules/express/lib/router/layer.js:95:5)
at /path/to/opentel/node_modules/express/lib/router/index.js:281:22
What did you expect to see?
I expected the call to counter.add(1) would increment the counter metric without errors, similar to the behavior when calling counter.add(1, {})
What did you see instead?
The error mentioned above.
Additional context
I intend to open a PR to fix this.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
1.0.0
What version of Node are you using?
v12.12.0
What did you do?
I was working through some basics examples of the metric API using plain javascript (i.e. not TypeScript), and I noticed that code that looks something like this
Ended up throwing an error like this
What did you expect to see?
I expected the call to
counter.add(1)
would increment the counter metric without errors, similar to the behavior when callingcounter.add(1, {})
What did you see instead?
The error mentioned above.
Additional context
I intend to open a PR to fix this.
The text was updated successfully, but these errors were encountered: