Skip to main content

Business Metrics

Gateway services emit Micrometer business metrics for operational dashboards, SLO investigation, and certification/runbook evidence. The source of truth for exact metric names and tag values is the BusinessMetrics class in each service, backed by executable BusinessMetricsTest coverage.

Metric Families

ServiceMetricsRequired bounded tagsOptional high-cardinality tags
Authgateway.auth.tokens.issued.totaloutcome, reasonclient_id
Processinggateway.transactions.total, gateway.transactions.latency, gateway.refunds.total, gateway.gift_card.refund_reroutes.total, gateway.gift_card.refund_rerouted_amount_cents.totaloutcome, type, reasonmerchant_id
Online transactiongateway.checkout.sessions.total, gateway.webhooks.deliveries.totaloutcome, event_type, sourcemerchant_id

Card-present reuses the processing transaction engine for in-person transaction metrics, so its transaction counters follow the processing metric contract.

Cardinality Gates

High-cardinality identity tags are disabled by default:

Env varConfig propertyAdds tagServices
METRICS_INCLUDE_CLIENT_IDgateway.metrics.include-client-idclient_idAuth
METRICS_INCLUDE_MERCHANT_IDgateway.metrics.include-merchant-idmerchant_idProcessing, online-txn, card-present

Keep these flags off unless the dashboard or incident explicitly needs the identity dimension and the expected series count is understood. Prefer joining metrics with structured request logs in Cloud Monitoring when investigating a single merchant or client.

Executable Coverage

The following targets prove the canonical names, bounded tags, and cardinality gates:

bazel test //services/auth:business_metrics_test \
//services/processing:business_metrics_test \
//services/online-txn:business_metrics_test

These tests should change in the same commit as any metric name, tag key, tag value, or cardinality gate change.