Skip to content

metrics support with OpenMetrics + JSON-LD export - #85

Open
nvdk wants to merge 1 commit into
mu-semtech:masterfrom
nvdk:feature/metrics-support
Open

metrics support with OpenMetrics + JSON-LD export#85
nvdk wants to merge 1 commit into
mu-semtech:masterfrom
nvdk:feature/metrics-support

Conversation

@nvdk

@nvdk nvdk commented Sep 8, 2026

Copy link
Copy Markdown
Member

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:

  • the JSON-LD output was not tested extensively
  • the template was tested on the delta-notifier, porting the metrics PR to use the functionalities offered in this PR.

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.
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.

1 participant