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.

Gauge `collect` function not working

See original GitHub issue

I’m trying to use the async collect function to asynchronously take a measurement.

In Typescript, the type is giving an error:

Argument of type '{ name: string; help: string; collect(): Promise<void>; }' is not assignable to parameter of type 'GaugeConfiguration<string>'.
  Object literal may only specify known properties, and 'collect' does not exist in type 'GaugeConfiguration<string>'.

And if I ignore the error, it seems that the function is not getting called at all.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:13

github_iconTop GitHub Comments

7reactions
maxpaincommented, Dec 12, 2020

Any update?

6reactions
rhlsthrmcommented, Oct 12, 2020

Any updates on this issue now that the related issues are fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

gauge.set_function() doesn't work in multiprocess mode #504
This doesn't work with gauge.set_function() which does not record its value. The provided function is just called during collection.
Read more >
How and when to use a Prometheus gauge - Tom Gregory
Functions not relevant to gauges. Most Prometheus functions do work with gauges, but there are some important exceptions such as increase ...
Read more >
How to use Micrometer Gauge the correct way? - Stack Overflow
You have couple solutions here: either build a Gauge using a builder and specifying the strongReference(true) or (better) make sure you hold ...
Read more >
prometheus - Go Packages
A Collector manages the collection of a number of Metrics, but for convenience, a Metric can also “collect itself”. Note that Gauge, Counter ......
Read more >
Metric types - Prometheus.io
Alerting based on metrics. Metric types. Counter; Gauge; Histogram; Summary. The Prometheus client libraries offer four core metric types. These are currently ...
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