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

MeterProvider::meter should not use &'static str #1015

Closed
tqwewe opened this issue Mar 31, 2023 · 1 comment · Fixed by #1018
Closed

MeterProvider::meter should not use &'static str #1015

tqwewe opened this issue Mar 31, 2023 · 1 comment · Fixed by #1018

Comments

@tqwewe
Copy link
Contributor

tqwewe commented Mar 31, 2023

It seems like the MeterProvider::meter method takes &'static str's for name (as well as version and schema_url).
https://docs.rs/opentelemetry/latest/opentelemetry/metrics/trait.MeterProvider.html

In my case, the string I want to use is not 'static, and this means I cannot use it to create meters.

I see that the instrument builder methods take impl Into<String> for the names. Maybe the meter functions could take the same, or Cow<'static, str> directly (since it seems like thats whats stored in the InstrumentationLibrary)

@djc
Copy link
Contributor

djc commented Mar 31, 2023

Cow<'static, str> probably makes sense, would you be able to send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants