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
Exporter for EclipseLink library #389
Exporter for EclipseLink library #389
Conversation
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.
Thanks for your PR. I'm not accepting new modules, however you can host this in your own repository and we've a section for integrations like this on Prometheus.io.
I've left some feedback on the metrics.
return Arrays.<MetricFamilySamples>asList( | ||
createCounter( | ||
"eclipselink_uow_commits_total", | ||
"Total number of unit of work commits", |
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.
Is uow a common term?
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.
Afaik, Unit of Work is a common term (see also https://stackoverflow.com/questions/3532258/unit-of-work-pattern-and-history). However, I should probably avoid the abbreviation in the metric name.
), | ||
createCounter( | ||
"eclipselink_cache_misses_total", | ||
"Total number of cache misses", |
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.
It's best to have cache requests as a metric too, it makes it easier to calculate the hit ratio.
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.
Agree, but the metric as such was not present in EclipseLink statistics. I can add cache requests as the sum of cache hits and cache misses.
), | ||
createCounter( | ||
"eclipselink_change_sets_processed_total", | ||
"Total number of processed change sets", |
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.
Are this one and the next one successes and failures? Failures and total is a bit easier to work 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.
Total is again not a metric directly exposed by EclipseLink, but I can sum the two to get it.
} | ||
), | ||
createCounter( | ||
"eclipselink_rcm_received_total", |
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.
What's rcm?
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.
RemoteCommandManager (https://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/sessions/coordination/RemoteCommandManager.html). I can also spell out the whole thing in the metric name.
private List<MetricFamilySamples> getTimers() { | ||
return Arrays.<MetricFamilySamples>asList( | ||
createGauge( | ||
"eclipselink_uow_commits_seconds", |
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.
These all sound like counters
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.
They all measure durations of particular operations in seconds, not sure how they can be counters. As durations, they can arbitrarily go up and down. Maybe I need to add the word 'duration' in the metric name.
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.
In that case see if you can get to the underlying data, and create a Summary from that
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 your point, but EclipseLink API returns one value at a time which represents the cumulative duration of operation. Unfortunately, I don't see how I can get enough data for a summary or a histrogram in one scrape.
Thank you for the comments :) |
This exporter follows the same structure as the Hibernate exporter, but exports the metrics available in EclipseLink. I had to write it for my project and thought I might try to contribute it. @brian-brazil I would be happy about any feedback.