Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Exporter for EclipseLink library #389

wants to merge 8 commits into from

Conversation

VitaNuova
Copy link

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.

Copy link
Contributor

@brian-brazil brian-brazil left a 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",
Copy link
Contributor

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?

Copy link
Author

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",
Copy link
Contributor

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.

Copy link
Author

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",
Copy link
Contributor

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

Copy link
Author

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's rcm?

Copy link
Author

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",
Copy link
Contributor

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

Copy link
Author

@VitaNuova VitaNuova Jun 20, 2018

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.

Copy link
Contributor

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

Copy link
Author

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.

@VitaNuova
Copy link
Author

Thank you for the comments :)

@VitaNuova VitaNuova closed this Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants