Counter tags not attached #5313
-
System.Diagnostics.DiagnosticSource v8.0 introduced the ability to instantiate a Counter with tags. But when tried to instantiate a Counter with tags, it's tags were not attached to the measurement, both in console and prometheus exporters. I have seen a similar issue with meter tags, but none with counter tags. This is how it shoud be ? or is it a bug ? The following exampele use version Example CodeMeter meter = new Meter("MyMeter", "1.0");
TagList counterTags = new TagList() {
{"counter_tag", true}
};
Counter<long> myCounter = meter.CreateCounter<long>("myCounter", null, null, counterTags);
MeterProvider meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("MyMeter")
.AddConsoleExporter()
.AddPrometheusHttpListener(options => options.UriPrefixes = new []{"http://localhost:9000"})
.Build();
myCounter.Add(1);
meterProvider.Dispose(); Console Output
Prometheus Output
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Counter tags (and other instrument tag), is not implemented in OTel yet. It is not something strictly from the spec, so we are working to find out how best to handle. There is a good chance it'll used to support the notion of "bound instruments", but nothing solid yet. Meter tags are now supported on Console/OTLPExporters (its called InstrumentationScope in OTLP) |
Beta Was this translation helpful? Give feedback.
-
Any new on this ? will it be better if I open an issue on this ? |
Beta Was this translation helpful? Give feedback.
Counter tags (and other instrument tag), is not implemented in OTel yet. It is not something strictly from the spec, so we are working to find out how best to handle. There is a good chance it'll used to support the notion of "bound instruments", but nothing solid yet.
Meter tags are now supported on Console/OTLPExporters (its called InstrumentationScope in OTLP)
https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Exporter.Console/CHANGELOG.md#170-rc1