Skip to content

Commit

Permalink
Fix SpanRef::set_attributes mutability (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtescher committed Apr 24, 2023
1 parent d560ff3 commit a9399e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions opentelemetry-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixed

- Fix `SpanRef::set_attributes` mutability requirement. [#1038](https://github.com/open-telemetry/opentelemetry-rust/pull/1038)

## v0.19.0
### Added
- Add `WithContext` to public api [#893](https://github.com/open-telemetry/opentelemetry-rust/pull/893).
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/trace/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl SpanRef<'_> {
///
/// [standard attributes]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.9.0/specification/trace/semantic_conventions/README.md
/// [opentelemetry_semantic_conventions]: https://docs.rs/opentelemetry-semantic-conventions
pub fn set_attributes(&mut self, attributes: impl IntoIterator<Item = KeyValue>) {
pub fn set_attributes(&self, attributes: impl IntoIterator<Item = KeyValue>) {
self.with_inner_mut(move |inner| inner.set_attributes(attributes))
}

Expand Down

0 comments on commit a9399e9

Please sign in to comment.