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.

apiMetrics not working (nest v8)

See original GitHub issue

All the apiMetrics aren’t showing up in the metrics page, only the default system ones are.

Using the basic snippet.

OpenTelemetryModule.forRoot({
      metrics: {
        hostMetrics: true, // Includes Host Metrics
        defaultMetrics: true, // Includes Default Metrics
        apiMetrics: {
          enable: true, // Includes api metrics
          // timeBuckets: [], // You can change the default time buckets
        },
        defaultLabels: {
          app: process.env.npm_package_name,
          version: process.env.npm_package_version,
        },
      },
    }),

if I only have apiMetrics enabled, I get:

# no registered metrics

as the metrics response. I have no idea how, but one in around 500 tries I saw for a second the needed metrics, but can’t reproduce - so in general, it doesn’t work.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pragmaticivancommented, Sep 26, 2021

Released in 2.5.0. defaultLabels is available inside apiMetrics property. Some metric plugins don’t allow custom labels yet.

0reactions
danshapircommented, Sep 24, 2021

@pragmaticivan My bad! I didnt await the otelSDK.start() in the main.ts.

I’ll hijack this issue for another issue. the defaultLabels parameter for the opentelemetryModule doesn’t work - it just ignores what I pass in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot when your thermostat won't turn on
The problem may be caused by an issue with your system. Nest Thermostat.
Read more >
Why API Monitoring Matters
Why API monitoring when you have lots of other monitoring platforms? 70% of API problems go un-noticed by existing tools, don't get caught...
Read more >
Google Nest API is not working / No device or entities are ...
The integration with Home Assistance that was using the Google Nest API is not working anymore. The API calls does not return anymore ......
Read more >
open-telemetry/opentelemetry-js
JS v8 prior to v8.12.0 will NOT work, because OpenTelemetry Node depends on the perf_hooks module introduced in v8.5.0 and performance.timeOrigin that ...
Read more >
Troubleshooting the Monitoring API
If you are having trouble with a method invocation, use the APIs Explorer (Try this API) widget on the reference page for that...
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