metrics support with OpenMetrics + JSON-LD export - #85
Open
nvdk wants to merge 1 commit into
Open
Conversation
Factory functions (createCounter, createGauge, createHistogram, createSummary) wrapping prom-client. Content-negotiating metricsHandler serving OpenMetrics text via prom-client and JSON-LD using the http://metrics.data.gift/ vocabulary. Includes a mu script to scaffold the /metrics endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea of this PR is to allow services to expose metrics in a consistent manner. To do this we expose metrics in OpenMetrics (an independent IETF draft standard). We avoid tie-in to prom-client by exposing wrapping factory functions (createCounter, createGauge, createHistogram, createSummary) . This allows use to move to a different library or own implementation if we would choose to do so,
The metrics endpoint needs to be set up by the service, but the template provides a handler and a mu script to set it up. The endpoint does content-negotiation serving OpenMetrics text via prom-client and JSON-LD using our own serialization. The serialization is based on the http://metrics.data.gift/ vocabulary included in this PR.
NOTES: