Describe the issue or suggestion
When creating a metric directly from the meter (i.e. meter.CreateCounter) you have the ability to set the unit type of the metric. When using the attributes to source gen a strongly typed metric it doesn't seem to be possible at this time to set the unit of those types of metrics.
For example:
Existing declaration:
[Histogram<long>(typeof(MetricTags))] public static partial Latency CreateLatency(Meter meter);
New declaration:
[Histogram<long>(typeof(MetricTags), unit: "ms")] public static partial Latency CreateLatency(Meter meter);
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Describe the issue or suggestion
When creating a metric directly from the meter (i.e. meter.CreateCounter) you have the ability to set the unit type of the metric. When using the attributes to source gen a strongly typed metric it doesn't seem to be possible at this time to set the unit of those types of metrics.
For example:
Existing declaration:
[Histogram<long>(typeof(MetricTags))] public static partial Latency CreateLatency(Meter meter);New declaration:
[Histogram<long>(typeof(MetricTags), unit: "ms")] public static partial Latency CreateLatency(Meter meter);Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.