Skip to content

Support for attributes of type any and template[any] #707

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

Merged
merged 10 commits into from
May 2, 2025

Conversation

lquerel
Copy link
Contributor

@lquerel lquerel commented Apr 21, 2025

This PR introduces support for attributes of type any and template[any], enabling more flexible handling of attribute values in the semconv.

Closes: #703

@lquerel lquerel self-assigned this Apr 21, 2025
@lquerel lquerel added the enhancement New feature or request label Apr 21, 2025
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 21.42857% with 33 lines in your changes missing coverage. Please review.

Project coverage is 76.5%. Comparing base (98bf4b4) to head (737b152).

Files with missing lines Patch % Lines
crates/weaver_emit/src/spans.rs 18.4% 31 Missing ⚠️
crates/weaver_live_check/src/advice.rs 0.0% 1 Missing ⚠️
crates/weaver_semconv/src/attribute.rs 66.6% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #707     +/-   ##
=======================================
- Coverage   77.0%   76.5%   -0.5%     
=======================================
  Files         65      65             
  Lines       4936    4978     +42     
=======================================
+ Hits        3803    3812      +9     
- Misses      1133    1166     +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lquerel lquerel marked this pull request as ready for review April 22, 2025 01:32
@lquerel lquerel requested a review from a team as a code owner April 22, 2025 01:32
@lquerel lquerel changed the title [WIP] Support for attributes of type any Support for attributes of type any Apr 22, 2025
@lquerel lquerel requested a review from a team as a code owner April 22, 2025 01:35
@lquerel lquerel changed the title Support for attributes of type any Support for attributes of type any and template[any] Apr 22, 2025
@lquerel lquerel moved this to To consider for the next release in OTel Weaver Project Apr 22, 2025
Copy link
Contributor

@jerbly jerbly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a way to compare compatibility of PrimitiveOrArrayTypeSpec. In the TypeAdvisor near your change, we compare the sample type with the semconv type with a simple inequality:

if attribute_type != semconv_attribute_type {

But now if attribute_type is string and semconv_attribute_type is any then these types are compatible.

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema changes LGTM!

Let's bring it up on the semconv tooling meeting - we'll need to communicate this to maintainers - some languages need to add support for any attributes or would generate invalid code.

@jsuereth jsuereth moved this from To consider for the next release to Next Release in OTel Weaver Project Apr 23, 2025
Copy link
Contributor

@jerbly jerbly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lquerel - setting this to "Request Changes" so we don't merge without fixing the TypeAdvisor. (see other comment).

@dyladan
Copy link
Member

dyladan commented Apr 30, 2025

What's the current status of this? Is it waiting more reviews or blocked on something?

@lmolkova
Copy link
Contributor

@dyladan ETA to get this one merged is this week and release is planned for the next week.

@lquerel
Copy link
Contributor Author

lquerel commented May 2, 2025

I think we need a way to compare compatibility of PrimitiveOrArrayTypeSpec. In the TypeAdvisor near your change, we compare the sample type with the semconv type with a simple inequality:

if attribute_type != semconv_attribute_type {

But now if attribute_type is string and semconv_attribute_type is any then these types are compatible.

@jerbly I made this change

@lquerel lquerel requested a review from jerbly May 2, 2025 01:39
Copy link
Contributor

@jerbly jerbly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good to go!

@lquerel lquerel merged commit 6c47d7c into open-telemetry:main May 2, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Next Release to Done in OTel Weaver Project May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support any type values in log/event attributes
6 participants