-
Notifications
You must be signed in to change notification settings - Fork 201
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
use global metric registry #128
base: main
Are you sure you want to change the base?
Conversation
Use the global REGISTRY, in order : 1) add exporter runtime metrics (fix pryorda#9 ) 2) add more metrics later (collection time for each object type) This patch is intended to expose internal metrics on `/metrics` only for the default section (so people with multiple sections `?section=something` don't get duplicate metrics).
First off, Thanks for your contributions. Is there any way you could add tests for this? |
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.
LGTM, Just need tests?
Codecov Report
@@ Coverage Diff @@
## master #128 +/- ##
===========================================
+ Coverage 0 93.62% +93.62%
===========================================
Files 0 4 +4
Lines 0 549 +549
===========================================
+ Hits 0 514 +514
- Misses 0 35 +35
Continue to review full report at Codecov.
|
@pryorda , The prometheus client library adds many metrics (plus process metrics on Linux). I was about to create a unit test to check Do you think we need more tests ?
|
That should be fine.
Sent from ProtonMail mobile
…-------- Original Message --------
On Jul 26, 2019, 6:07 PM, Frank lin Piat wrote:
***@***.***(https://github.com/pryorda) ,
The prometheus client library adds many metrics (plus process metrics on Linux).
I was about to create a unit test to check python_info only (value and labels).
Also, I was considering to a a test to ensure those metrics are published on the default section only.
Do you think we need more tests ?
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 633.0
python_gc_objects_collected_total{generation="1"} 301.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 191.0
python_gc_collections_total{generation="1"} 17.0
python_gc_collections_total{generation="2"} 1.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="7",patchlevel="2",version="3.7.2"} 1.0
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#128?email_source=notifications&email_token=ABLCAHFBA6FGBU6ELSLNRDTQBOGTLA5CNFSM4IGVUDC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD257AXI#issuecomment-515633245), or [mute the thread](https://github.com/notifications/unsubscribe-auth/ABLCAHFPZ4P7QTINMVW2PP3QBOGTLANCNFSM4IGVUDCQ).
|
Codecov Report
@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 80.29% 81.64% +1.34%
==========================================
Files 4 4
Lines 873 888 +15
==========================================
+ Hits 701 725 +24
+ Misses 172 163 -9
Continue to review full report at Codecov.
|
and declare metrics vmware_exporter_build_info{version="..."}
use exporter_metrics in configuration file
E302 expected 2 blank lines
Hello Daniel, Does this look good to you @pryorda ? |
Hey @finkr, Appreciate the work on this. Ill work on getting it tested and updated. Thanks for your patience on this |
Hello Daniel, I looked at other issues and pull request (making the default section optional). Also the exporters should always return a page with the exporters metrics , and avoid http/500 errors with empty page. That's not easy to do with a single page with both VMware metrics and the exporters metrics I am seriously considering to move the exporters own metric to a separate page . This means users would have to configure two or more targets in Prometheus. |
Sorry for the delay. What would happen if you hit the endpoint multiple times quickly? |
@pryorda , Handling a single prometheus registry containing both vmware metrics AND the the exporter own metrics proves to be quite challenging, especially when it comes to ensure that we provide technical metrics even when an exception is raised when scraping the vCenter. I have some work going on to split the exporter's own metrics in a separate endpoint (which means users will have to configure two prometheus jobs. And they may forget to do so unfortunately) I'll try to submit that work soon. |
Sorry for the delay. I'm def not a fan of moving to two endpoints. Do you know if there is a best practice for service metrics vs vmware metrics? |
For those exporters that are designed to expose metrics from multiple targets, it seems common to have 1 endpoint to expose the exporter own metrics, and another endpoints for targets.
Some exceptions I fount, where all metrics are exposed at once : statsd_exporter, pushgateway, ipmi_exporter is a bit different because local ipmi interface are exposed under |
Use the global REGISTRY, in order :
This patch is intended to expose internal metrics on
/metrics
only for the default section (so people with multiple sections?section=something
don't get duplicate metrics).