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

get_meter Is Missing Required Attributes Arg #3695

Closed
jnadler opened this issue Feb 21, 2024 · 2 comments · Fixed by #4015
Closed

get_meter Is Missing Required Attributes Arg #3695

jnadler opened this issue Feb 21, 2024 · 2 comments · Fixed by #4015
Labels
bug Something isn't working good first issue Good first issue help wanted

Comments

@jnadler
Copy link

jnadler commented Feb 21, 2024

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

This is not an environment specific issue. It appears (apologies if I'm confused!) that the python impl is missing a behavior that is required by the spec.

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

In MeterProvider, the method get_meter does not have an argument attributes.

The spec says that:

Get a Meter: This API MUST accept the following parameters:

The last of those parameters, after schema_url, is a set of attributes:

[since 1.13.0] attributes: Specifies the instrumentation scope attributes to associate with emitted telemetry.

What is the expected behavior?
What did you expect to see?

Expected to see the spec fully implemented. Being able to specify crosscutting attributes at init time would be extremely valuable.

What is the actual behavior?
What did you see instead?

The final arg for get_meter is schema_url, attributes is not present: https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/__init__.py#L512

Additional context
Add any other context about the problem here.

@jnadler jnadler added the bug Something isn't working label Feb 21, 2024
@jnadler
Copy link
Author

jnadler commented Feb 23, 2024

@ocelotl Would you be open to a PR for this?

@srikanthccv
Copy link
Member

Yes, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants