fix: set service.instance.id for unique instance label #144

Merged
argoyle merged 1 commits from fix/otel-service-instance-id into main 2026-05-29 06:39:16 +00:00
Owner

Adds service.instance.id (pod hostname) to OTEL_RESOURCE_ATTRIBUTES. The OTLP->Prometheus exporter maps it to the instance label on metrics and target_info, fixing (1) multi-replica series collisions and (2) the (job, instance) target_info join used by the Shiny eventsourced dashboard/alerts (currently failing with duplicate-series DatasourceError for multi-pod services). Build + race tests pass.

Adds service.instance.id (pod hostname) to OTEL_RESOURCE_ATTRIBUTES. The OTLP->Prometheus exporter maps it to the instance label on metrics and target_info, fixing (1) multi-replica series collisions and (2) the (job, instance) target_info join used by the Shiny eventsourced dashboard/alerts (currently failing with duplicate-series DatasourceError for multi-pod services). Build + race tests pass.
argoyle added 1 commit 2026-05-29 06:28:42 +00:00
fix: set service.instance.id so metrics carry a unique instance label
otelsetup / vulnerabilities (pull_request) Successful in 1m58s
otelsetup / test (pull_request) Successful in 2m35s
pre-commit / pre-commit (pull_request) Successful in 6m20s
717ac59faf
SetupOTelSDK now adds service.instance.id (the pod hostname) to
OTEL_RESOURCE_ATTRIBUTES. The OTLP->Prometheus exporter maps it to the
`instance` label on both metrics and target_info, which (1) stops
multi-replica services from colliding on a single series and (2) gives
PromQL joins a unique (job, instance) key. Falls back to the service name
when the hostname is unavailable.
argoyle scheduled this pull request to auto merge when all checks succeed 2026-05-29 06:28:46 +00:00

Coverage Report

Total coverage: 23%

## Coverage Report Total coverage: **23%**
argoyle merged commit afa847c76c into main 2026-05-29 06:39:16 +00:00
argoyle deleted branch fix/otel-service-instance-id 2026-05-29 06:39:16 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shiny/otelsetup#144