Skip to content

Add missing set value attribute shortcuts#8255

Merged
jack-berg merged 6 commits into
open-telemetry:mainfrom
trask:set-attribute-string-value
May 11, 2026
Merged

Add missing set value attribute shortcuts#8255
jack-berg merged 6 commits into
open-telemetry:mainfrom
trask:set-attribute-string-value

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented Apr 6, 2026

The shortcut was added to AttributesBuilder:

default AttributesBuilder put(String key, Value<?> value) {
return put(valueKey(key), value);
}

I probably just forgot to add them elsewhere.

Copy link
Copy Markdown
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

approve with passing build

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.87%. Comparing base (3351182) to head (1ac4a4c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8255      +/-   ##
============================================
- Coverage     90.88%   90.87%   -0.02%     
- Complexity     7986     7987       +1     
============================================
  Files           898      898              
  Lines         24115    24119       +4     
  Branches       2412     2412              
============================================
+ Hits          21916    21917       +1     
  Misses         1456     1456              
- Partials        743      746       +3     

☔ 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.

@trask trask marked this pull request as ready for review April 8, 2026 19:03
@trask trask requested a review from a team as a code owner April 8, 2026 19:03
@jkwatson
Copy link
Copy Markdown
Contributor

jkwatson commented Apr 8, 2026

I won't block it, but I think I remember we left these out intentionally, since it's not a common use-case, and one we don't want to encourage people outside of instrumentation authors from using?

/**
* Sets a {@link Value} attribute on the {@code LogRecord}. If the {@code LogRecord} previously
* contained a mapping for the key, the old value is replaced by the specified value.
*
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

add comment here and elsewhere

Instrumentations should assume that backends do not index individual properties of complex attributes, that querying or aggregating on such properties is inefficient and complicated, and that reporting complex attributes carries higher performance overhead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ping @trask 🙂

This was referenced May 4, 2026
…g-value

# Conflicts:
#	api/all/src/main/java/io/opentelemetry/api/trace/Span.java
#	docs/apidiffs/current_vs_latest/opentelemetry-api.txt
@otelbot otelbot Bot added the api-change Changes to public API surface area label May 11, 2026
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented May 11, 2026

⚠️ API changes detected — additional maintainer review required

@jack-berg @jkwatson

This PR modifies the public API surface area of the following module(s):

  • opentelemetry-api

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

@jack-berg jack-berg merged commit 7ddb3b2 into open-telemetry:main May 11, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to public API surface area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants