-
Notifications
You must be signed in to change notification settings - Fork 45
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
Replace exometer with prometheus #153
Conversation
This commit replaces exometer/exometer_core libraries with prometheus.erl to collect RADIUS metrics. All metrics names are preserved as it was before. Only internal structure of metrics names changed as exometer stored metrics names as list of atoms, but prometheus stores metrics names as binary strings. The one backward compatibility change is - prometheus histogram observations are stored into buckets, but exometer histograms collected data and calculated quantiles. Now calculation of quantiles should be done on prometheus site via prometheus functions.
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.
After reading all those changes, I'm seriously annoyed by the way the exometer stuff works.
I wonder if it wouldn't be cleaner and simpler to:
- rip out/revert all the exometer support
- rewrite this as a prometheus exporter reusing the existing SNMP and eradius_counter stuff
The counter collector might need some enhancements, but it looks much more modular and less intrusive that the exometer crap.
@mgumz comments?
update_client_request(retransmission, {{CName, CIP, undefined}, {SName, SIP, SPort}}, Ms) -> | ||
update_request(client, retransmission, {CName, CIP, SName, SIP, SPort}, Ms); | ||
update_client_request("pending", {{CName, CIP, undefined}, {SName, SIP, SPort}}, Pending) -> | ||
update_request(client, "pending", {CName, CIP, SName, SIP, SPort}, Pending); |
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 don't really like this excessive replacing ot atoms with strings. The conversion can always done later when generating the metrics name.
| request_invalid_server_total_undefined_undefined_counter | [$NAME, $IP, $PORT] | counter | | ||
| request_malformed_server_total_undefined_undefined_gauge | [$NAME, $IP, $PORT] | histogram | | ||
| request_malformed_server_total_undefined_undefined_counter | [$NAME, $IP, $PORT] | counter | | ||
| request_dropped_server_total_undefined_undefined_gauge | [$NAME, $IP, $PORT] | histogram | |
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 appreciate the effort to keep the existing names, but prometheus has it's own idea what metric names should look like and I think we should follow their lead (@mgumz what's you take on this?)
I have pushed branch - https://github.com/0xAX/eradius/tree/prom-collector with prometheus collector based on eradius_counter things (most of all the things goes here https://github.com/0xAX/eradius/blob/prom-collector/src/eradius_prometheus_collector.erl), should be similar to what prometheus_diameter_collector does. I have met two issues with this approach:
The possible solution here could be not just return
@RoadRunnr @mgumz What do you think about this? |
going to close this PR as new one will be opened |
These commits replaces exometer/exometer_core libraries with prometheus.erl to collect RADIUS metrics.
All metrics names are preserved as it was before. Only internal structure of metrics names changed as exometer stored metrics names as list of atoms, but prometheus stores metrics names as binary strings. In addition variadic parts of metrics names moved to prometheus labels.
So before it was:
Now it is:
with
[$NAME, $IP, $PORT]
labels.The one backward compatibility change is - prometheus histogram observations are stored into buckets, but exometer histograms collected data and calculated quantiles. Now calculation of quantiles should be done on prometheus site via prometheus functions.