Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument tags not attached #5478

Open
YarinOmesi opened this issue Mar 16, 2024 · 2 comments
Open

Instrument tags not attached #5478

YarinOmesi opened this issue Mar 16, 2024 · 2 comments
Labels
enhancement New feature or request metrics

Comments

@YarinOmesi
Copy link

YarinOmesi commented Mar 16, 2024

What are you trying to achieve?

System.Diagnostics.DiagnosticSource v8.0 introduced the ability to instantiate an insrument with tags. for example Counter with tags.

Using System.Diagnostics.DiagnosticSource v8.0, when creating and exporting a counter with tags, I expect tags declared in an instrument will be attached and be exported (in prometheus).

Example Code:

Meter 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();

What did you expect to see?

I expect tags declared in an instrument will be attached and be exported (in prometheus).

Actual output, without the instrument tags

# TYPE myCounter_total counter
myCounter_total 1 1706978095318

# EOF

Additional context.

Discussed In #5313

Relevant docs:
https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics#metrics-enrichment

@trask
Copy link
Member

trask commented Mar 26, 2024

hi @YarinOmesi! can you describe the change you would like to see in terms of the specification (instead of in terms of .Net)?

cc @open-telemetry/dotnet-approvers

@cijothomas cijothomas transferred this issue from open-telemetry/opentelemetry-specification Mar 27, 2024
@cijothomas
Copy link
Member

hi @YarinOmesi! can you describe the change you would like to see in terms of the specification (instead of in terms of .Net)?

cc @open-telemetry/dotnet-approvers

It looks like some miscommunicated! I did ask to open a new issue to track this, but I meant to open one on the otel .net repo!

Transferring issue to otel .net repo.

@reyang reyang added the enhancement New feature or request label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request metrics
Projects
None yet
Development

No branches or pull requests

5 participants