-
Notifications
You must be signed in to change notification settings - Fork 825
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
docs: add observableGauge to the prometheus experimental example #4267
docs: add observableGauge to the prometheus experimental example #4267
Conversation
Signed-off-by: Francois LP <[email protected]>
Signed-off-by: Francois LP <[email protected]>
…xperimental-example
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4267 +/- ##
==========================================
- Coverage 92.22% 91.79% -0.43%
==========================================
Files 336 214 -122
Lines 9521 6547 -2974
Branches 2017 1465 -552
==========================================
- Hits 8781 6010 -2771
+ Misses 740 537 -203 |
…xperimental-example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening this PR.
I'm wondering if it wouldn't be better to just link to the documentation on metrics instrumentation from the readme. The observable gauge is not really prometheus specific and its behvaior does not vary depending on which exporter is used. 🤔
from @pichlermarc Co-authored-by: Marc Pichler <[email protected]>
I did the PR in the first place because I was trying to move away from |
…xperimental-example
@pichlermarc any update? 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I guess it wouldn't hurt to have the example here. 🙂
I think we can make it sync though for simplicity.
observableGauge.addCallback(async observableResult => { | ||
const value = await randomMetricPromise(); | ||
observableResult.observe(value, attributes); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, why not observe the value synchronously here? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, why not observe the value synchronously here? 🤔
Often, when I had to observe a value at querying time, it was from an async process, so I just replicated what I often deal with :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the ability to collect gauge asynchronously can be a good point to present in the example.
observableGauge.addCallback(async observableResult => { | ||
const value = await randomMetricPromise(); | ||
observableResult.observe(value, attributes); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the ability to collect gauge asynchronously can be a good point to present in the example.
…xperimental-example
Hey @pichlermarc , should we merge the PR now it is approved? :) |
…xperimental-example
…xperimental-example
…xperimental-example
…n-telemetry#4267) * docs: add observableGauge to the prometheus experimental example Signed-off-by: Francois LP <[email protected]> * docs: add gauge image to README Signed-off-by: Francois LP <[email protected]> * refactor: change comment wording from @pichlermarc Co-authored-by: Marc Pichler <[email protected]> --------- Signed-off-by: Francois LP <[email protected]> Co-authored-by: Marc Pichler <[email protected]> Co-authored-by: Daniel Dyla <[email protected]>
Which problem is this PR solving?
Lack of documentation for async functions and gauge observable regarding the prometheus experimental example.
Short description of the changes
createObservableGauge()
function.Type of change
improve documentation
How Has This Been Tested?
Checklist: