prometheus / prometheus/client_ruby
Supporting OpenMetrics
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 558
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
We should support OpenMetrics. I've started this work in a temporary branch, will start opening PRs.
But this seems to be the master list of things to do.
This is a breaking change that we should release as 3.0.
We should have previous minor versions with deprecation warnings about the things we'll be changing.
Todo
-
Basic Formatting hygiene
- Format negotiation with OpenMetrics Accept Header
- Add tests to the OpenMetrics formatter I wrote
- #EOF
- #UNIT including validation
- forcing
_totalon counters. This is a breaking change, released in 3 stages- Warn on counters that are not suffixed with
_total - (next major version) Forcefully add
_totalto counters. Those that come with_totalsuffix, remove it and warn, in preparation for next major. - (next major version) Error on counters suffixed
_total
- Warn on counters that are not suffixed with
-
Timestamps Output
- Merge PR #172 which will help with outputting "updated_at" timestamps for time series
-
series_createdseries
-
Exemplars
-
New Metric types
- StateSet
- Info
-
Document breaking changes (UPGRADING.md)
- If you called
Metric#valuesorStores#all_values, you'll get objects with timestamps instead of simply float - Naming convention things: You must pass the unit and not include it in the name. You must not add _total to your counters. We'll add both automatically
- If you called
Questions:
-
Is this the most up-to-date documentation we have?
-
The
_createdchild series:
a. Is it only supported forcounter,summaryandhistogram?
b. Is this the time the metric got declared / added to the registry? Or is this the time the metric was first observed?
c. Do we report one_createdvalue per metric or per time series? In other words, if I have:http_server_requests_total{code="200"} 10.0 1590078339.214435 http_server_requests_total{code="400"} 1.0 1590078339.214435Should I have:
http_server_requests_created{code="200"} 1590078336.554018 http_server_requests_created{code="400"} 1590078336.554018Or just:
http_server_requests_created 1590078336.554018
And if the former, do we have a separate one per Histogram Bucket?Note: in the documentation, all examples happen to not have labels. Moreover, trying to figure this out by experimentation, I think there may be a problem with the Python parser. For Counters, it only accepts the second example (no labels for
_created). For Histograms, it only accepts "all the labels minusle". Both kind of make sense independently, but they seem like they should be mutually exclusive. -
Exemplars
a. Are they only available forcounterandhistogram?
b. We are reporting an exemplar, of the many the app could have reported. Does it have to be the latest? Can it be an "unstable" pick between the many? (the reason I ask is that if different scrapes are ok to report different exemplars, even if the metric hasn't changed, then we don't need to share those exemplars between processes, and we can just keep them in the Metric object itself, instead of persisting to the files)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the OpenMetrics formatter mentioned in the issue and the completed PR #172, then separate the checklist into independently scoped changes. The issue names formatter tests, timestamp output, exemplars, new metric types, naming validation, and UPGRADING.md, but no file paths or single completion target. Done would require a decided subset of the checklist with tests and documentation updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100