MetricReader is not bound to a MetricProducer
See original GitHub issueWhat version of OpenTelemetry are you using?
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/exporter-prometheus": "^0.28.0",
"@opentelemetry/host-metrics": "^0.27.1",
What version of Node are you using?
v16.13.0
What did you do?
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');
const { HostMetrics } = require('@opentelemetry/host-metrics');
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
const exporter = new PrometheusExporter(
{
startServer: true
}, () => {
console.log('prometheus scrape endpoint: http://localhost:9464/metrics')
}
)
const meterProvider = new MeterProvider({
exporter,
interval: 2000
})
const hostMetrics = new HostMetrics({ meterProvider, name: 'example-host-metrics' })
hostMetrics.start()
const fastify = require('fastify')()
fastify.listen(8080)
What did you expect to see?
Host metrics
What did you see instead?
By reaching the URL: http://localhost:9464/metrics I get:
# failed to export metrics: Error: MetricReader is not bound to a MetricProducer
Additional context
I was trying to add the HostMetrics to the opentelemetry.NodeSDK component, but unsuccessfully. So I tried the basic example, and I get the same error.
Issue Analytics
- State:
- Created a year ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Error When exporting metrics while using OpenTelemetry ...
Hi, I configured Opentelemtry collector to export metrics and traces. I am getting access errors and unable to check any data come ...
Read more >OpenTelemetry collector does not export Metric attributes to ...
I am attempting to export Metrics to an OpenTelemetry collector container from my Node.js app, which then exports it to New Relic. I...
Read more >Metrics Data Model | OpenTelemetry
Explicit boundary values. These values denote the lower and upper bounds for buckets and whether not a given observation would be recorded in...
Read more >https://git.2li.ch/clitools/restic/commit/ca8c3b4f...
metric/metricproducer/producer.go | 28 + ... Transport affects all clients which is not what we want. ... This defines size(bounds) + 1 (= N)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will get the chance to test it by my side on the next days
Sorry, it’s not
addMetricProviderbut ratheraddMetricReader. The code snippet I use is as follows: