Describe the bug
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.
Affected version
GitHub Copilot CLI 1.0.88
Steps to reproduce the behavior
COPILOT_OTEL_FILE_EXPORTER_PATH=/tmp/otel.jsonl copilot -p "Reply with: pong"
- 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.
Linux (WSL2), x86_64.
Describe the bug
Copilot CLI exports cumulative metrics (
gen_ai.client.token.usage,github.copilot.tool.call.count, ...) with onlyservice.nameandservice.versionon the resource. There is noservice.instance.idor 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.idbecomes theinstancelabel, 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.Affected version
GitHub Copilot CLI 1.0.88
Steps to reproduce the behavior
COPILOT_OTEL_FILE_EXPORTER_PATH=/tmp/otel.jsonl copilot -p "Reply with: pong"resourceof the metric lines in/tmp/otel.jsonl. It only hasservice.nameandservice.version.OTEL_EXPORTER_OTLP_ENDPOINTpointing at a collector that writes to Prometheus. Both sessions update the same series.Expected behavior
Each process sets
service.instance.idon 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
resourceAttributesin 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.Linux (WSL2), x86_64.