You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OTel metrics have no service.instance.id, so concurrent sessions write to the same metric streams #5005
Copilot CLI exports cumulative metrics (gen_ai.client.token.usage, github.copilot.tool.call.count, ...) with only service.name and service.version on the resource. There is no service.instance.id or any other attribute that is unique per process.
When several CLI processes export to the same backend, their metric streams have the same identity. That breaks the OTel single-writer rule. In Prometheus and Mimir, service.instance.id becomes the instance label, so every session writes to the same series. Each process starts its counters from zero, and the backend sees resets and out-of-order values. Sums and rates across users are wrong.
Check the resource of the metric lines in /tmp/otel.jsonl. It only has service.name and service.version.
Run two sessions at the same time with OTEL_EXPORTER_OTLP_ENDPOINT pointing at a collector that writes to Prometheus. Both sessions update the same series.
Expected behavior
Each process sets service.instance.id on the resource. A random UUID at startup is what the semantic conventions recommend. The session ID would also work.
Additional context
We can't work around this with resourceAttributes in enterprise managed settings, because that value is the same for every user. Right now we drop the CLI metrics in our collector and build our own metrics from the spans instead.
Activity