-
Notifications
You must be signed in to change notification settings - Fork 835
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
Update metrics example #2658
Update metrics example #2658
Conversation
Thanks for taking on all these examples and docs. Its great to have them updated |
@dyladan @vmarchaud There is one thing in this example that I wasn't sure about which was searching prometheus for "cpu_core_usage". I'm not seeing that option in the metrics explorer in prometheus. I can see other "process_cpu_seconds_total" but not "cpu_core_usage". If you're able to shed some light on this, I'd appreciate that. Thanks! |
Codecov Report
@@ Coverage Diff @@
## main #2658 +/- ##
==========================================
- Coverage 92.88% 92.52% -0.37%
==========================================
Files 143 144 +1
Lines 5158 5177 +19
Branches 1102 1102
==========================================
- Hits 4791 4790 -1
- Misses 367 387 +20
|
The function signatures used in the example are the latest, not published WIP version in api-metrics. I'm not sure if the example should be reverted back to the previous versions. AFAICT, the examples should be updated with the api-metrics change. People can always find the example that works with v0.27.0 at https://github.com/open-telemetry/opentelemetry-js/blob/experimental/v0.27.0/examples/metrics/metrics/observer.js. |
Hmm @legendecas is right that the current example is actually more up to date than what is here, but I think it's confusing to have an
|
@MSNev does your approval that you support the |
Yes, the examples should be using the production versions as that is what (I assume / expect) new users will be using these for. It does mean that there will be a delay in "adding" new example features. |
Do you think we should have a location for WIP examples? If so, where would you vote? I think I'd like to have the WIP examples directly in the package directory they are an example of. |
I think we should remove the example, or move it to the wip sdk but that will require time to keep it up to date so i think removing it make more sense for now |
I like the idea of moving it to a wip sdk. And if the wip examples are not working (from time to time because of updates/changes) then users will know it's because they're "wip" examples. |
Can you handle that in this PR? |
@dyladan This is completed. |
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.
A few things to fix the lint step. Otherwise looks good
experimental/packages/opentelemetry-sdk-metrics-base/examples/README.md
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-sdk-metrics-base/examples/README.md
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-sdk-metrics-base/examples/README.md
Outdated
Show resolved
Hide resolved
…README.md Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
…README.md Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Which problem is this PR solving?
This metrics example was referencing an older version of opentelemetry packages which was causing an error of
TypeError: meter.createObservableGauge is not a function
Fixes # (issue)
Short description of the changes
Type of change
How Has This Been Tested?
Tested examples locally.
Checklist: