Skip to content

Polish custom metric names

Administrator requested to merge prepend-component-to-metric-names into main

Created by: hacklschorsch

Prepend payment_ to all of our custom metric names to group metrics from PaymentServer under one name space in Prometheus.

This results in the following metrics being exported:

payment_processors_stripe_charge_attempts
payment_processors_stripe_charge_successes
payment_redemption_signatures_issued
payment_redemption_voucher_redeemed

The non-custom http endpoints continue to be available under their Prometheus style labelled names, e.g. http_responses_total{instance="payments", path="v1/stripe/charge"}.

Rationale

From the OpenMetrics spec:

Metric names should indicate what piece of code they come from. So a company called A Company Manufacturing Everything might prefix all metrics in their code with "acme_", and if they had a HTTP router library measuring latency it might have a metric such as "acme_http_router_request_seconds" with a Help string indicating that it is the overall latency.

Merge request reports