[gateway] Add Prometheus identity labels - #4219
Conversation
beryllw
left a comment
There was a problem hiding this comment.
My main question is about the Gateway identity model. We now have:
gateway.id: logical Gateway deploymentgateway.instance-id: individual Gateway instance used for diagnosticsgateway.host: host or network location
Is gateway.host expected to uniquely identify each Gateway replica? If it only represents location, multiple replicas may share the same value. In that case, could we expose the existing gateway.instance-id as the per-replica metric label instead?
beryllw
left a comment
There was a problem hiding this comment.
Could we add an integration test that starts the Gateway with gateway.id and gateway.host, then verifies the labels from the actual /metrics endpoint? It would cover the configuration, lifecycle, and exporter wiring together.
Good point. I removed gateway.host and reused the existing gateway.instance-id as the per-replica identity. It is now exposed as the instance_id metric label, while gateway.id remains the identity shared by one logical Gateway deployment. This avoids introducing two overlapping per-replica identity configurations. |
Added an end-to-end HTTP test that starts the Gateway with gateway.id and gateway.instance-id, fetches the actual /metrics endpoint, and verifies the gateway_id and instance_id labels. The existing configuration tests continue to cover YAML and environment-variable loading. |
Purpose
Linked issue: close #4217
Brief change log
Tests
API and Format
Documentation