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

Add set_attribute function #34

Merged
merged 1 commit into from
Jul 29, 2023
Merged

Add set_attribute function #34

merged 1 commit into from
Jul 29, 2023

Conversation

Protryon
Copy link
Contributor

This PR:

  • Adds a function set_attribute to OpenTelemetrySpanExt to allow setting attributes directly on the OpenTelemetry SpanBuilder.

This allows users to set more than the tracing maximum of 32 fields.

There was a workaround I came up with without using the function involving wrapping the Registry in an Arc and accessing OtelData directly, but that led to this bug in tracing-subscriber.

@Protryon Protryon requested a review from jtescher as a code owner July 25, 2023 14:14
Copy link
Collaborator

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

This looks good, thanks @Protryon

@jtescher jtescher merged commit 7b77d33 into tokio-rs:v0.1.x Jul 29, 2023
jtescher added a commit that referenced this pull request Aug 4, 2023
Changelog:

### Added

- Add `OpenTelemetrySpanExt::set_attribute` function (#34)

### Breaking Changes

- Upgrade to `v0.20.0` of `opentelemetry` (#36)
  For list of breaking changes in OpenTelemetry, see the
[v0.20.0
changelog](https://github.com/open-telemetry/opentelemetry-rust/blob/v0.20.0/opentelemetry-api/CHANGELOG.md#v0200).
@eopb
Copy link

eopb commented Oct 16, 2023

The 32 field maximum has also been fix over in tracing tokio-rs/tracing#2508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants