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

[bug] Throw an exception when an unsupported counter name is created #5990

Closed
Jebarson opened this issue Nov 19, 2024 · 3 comments
Closed

[bug] Throw an exception when an unsupported counter name is created #5990

Jebarson opened this issue Nov 19, 2024 · 3 comments
Labels
bug Something isn't working needs-runtime-change Issues which likely require changes from dotnet runtime - typically DiagnosticSource package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Comments

@Jebarson
Copy link

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry 1.1.0
TBD TBD

Runtime Version

4.8

Description

When a counter is created with a space within it, There are no errors thrown but the metrics just doesnt get published / exported.

Steps to Reproduce

SomeMeter.CreateCounter("Code Generated");

Expected Result

Throws an exception when the counter is created suggesting the name is not supported.

Actual Result

Doesn't throw an error but also does not post the metrics

Additional Context

No response

@Jebarson Jebarson added bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member labels Nov 19, 2024
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Nov 19, 2024
@martinjt
Copy link
Member

This is something that is part of the runtime team unfortunately, as we don't control that API.

From OpenTelemetry's perspective that is an invalid counter, but from .NET's perspective it's valid. There's not much we can do I'm afraid.

@martinjt martinjt added needs-runtime-change Issues which likely require changes from dotnet runtime - typically DiagnosticSource package and removed needs-triage New issues which have not been classified or triaged by a community member labels Nov 20, 2024
@cijothomas
Copy link
Member

Additionally, throwing exceptions is generally not preferred/allowed in any of the APIs. It is acceptable to throw, only in the startup time (like setting up providers), but not afterwards. Since instruments can be created anytime, we won't be able to throw exceptions.

(However, I think it maybe acceptable to throw in debug mode.)

@cijothomas
Copy link
Member

Closing this as there is no plan to make any changes in this repo. If there are other ideas/questions, feel free reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-runtime-change Issues which likely require changes from dotnet runtime - typically DiagnosticSource package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

No branches or pull requests

3 participants