dotnet / dotnet/extensions

Microsoft.Gen.Metrics doesn't allow int-typed tag (error METGEN012)

Open
#6,720 1 comment 0 reactions 0 assignees View on GitHub
area-telemetry
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

In the `Microsoft.Extensions.Telemetry.Abstractions` package, the metrics source generator `Microsoft.Gen.Metrics` allows `string` and `enum` types for tag values, and emits error METGEN012 otherwise:

OpenTelemetry semantic conventions define `int`-typed attributes for some metrics, in particular the `server.port` attribute in [messaging.client.operation.duration](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-metrics/#metric-messagingclientoperationduration) and in [RPC metrics](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-metrics/#attributes). I think Microsoft.Gen.Metrics should allow `int`, too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.