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

Resource from environment specifies a schema URL #5729

Closed
anuraaga opened this issue Aug 18, 2023 · 1 comment · Fixed by #5911
Closed

Resource from environment specifies a schema URL #5729

anuraaga opened this issue Aug 18, 2023 · 1 comment · Fixed by #5911
Labels
Bug Something isn't working

Comments

@anuraaga
Copy link
Contributor

I'm not sure if it's a bug or not but I noticed that resource specified with OTEL_RESOURCE_ATTRIBUTES has a schema URL attached.

return Resource.create(resourceAttributes.build(), ResourceAttributes.SCHEMA_URL);

As it's user-provided attributes, I suspect it's not valid to define any schema URL for it as the attributes are unknown. Would it be better to create a schemaless resource for it? In practice, I don't know if it's a big deal as it's correctly pointed out that merging resource of different schemas is undefined behavior

// currently, behavior is undefined if schema URLs don't match. In the future, we may

But I think it could capture the intent of OTEL_RESOURCE_ATTRIBUTES better.

@anuraaga
Copy link
Contributor Author

BTW, having an OTEL_RESOURCE_ATTRIBUTES_SCHEMA_URL to allow the user who provided those attributes to also provide a schema could be the most precise implementation, though before that I guess schemaless would be closer than arbitrary schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant