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

Rust Getting Started Docs Error - the trait bound opentelemetry_stdout::SpanExporter: opentelemetry_sdk::export::trace::SpanExporter is not satisfied #5745

Open
TownCube opened this issue Dec 9, 2024 · 6 comments
Labels
bug Something isn't working sig:rust

Comments

@TownCube
Copy link

TownCube commented Dec 9, 2024

What needs to be changed?
Update Rust Getting Started example so it compiles.

What is the name + path of the page that needs changed? https://opentelemetry.io/docs/languages/rust/getting-started/

Additional context: The error I get after copy/pasting the getting started example:

error[E0277]: the trait bound `opentelemetry_stdout::SpanExporter: opentelemetry_sdk::export::trace::SpanExporter` is not satisfied
   --> src/dice_server.rs:40:31
    |
40  |         .with_simple_exporter(SpanExporter::default())
    |          -------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `opentelemetry_sdk::export::trace::SpanExporter` is not implemented for `opentelemetry_stdout::SpanExporter`
    |          |
    |          required by a bound introduced by this call
    |
help: trait impl with same name found
   --> /home/TownCube/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry-stdout-0.27.0/src/trace/exporter.rs:33:1
    |
33  | impl opentelemetry_sdk::export::trace::SpanExporter for SpanExporter {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `opentelemetry_sdk` are being used?
note: required by a bound in `opentelemetry_sdk::trace::Builder::with_simple_exporter`
   --> /home/TownCube/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry_sdk-0.22.1/src/trace/provider.rs:161:36
    |
161 |     pub fn with_simple_exporter<T: SpanExporter + 'static>(self, exporter: T) -> Self {
    |                                    ^^^^^^^^^^^^ required by this bound in `Builder::with_simple_exporter`

Bumping the versions seems to resolve it but didn't want to blindly raise a PR to update without understanding the ramifications in case this break is a sign of something bigger not working correctly.

opentelemetry = "0.27.1"
opentelemetry_sdk = "0.27.1"
opentelemetry-stdout = { version = "0.27.0", features = ["trace"] }
@TownCube TownCube added the bug Something isn't working label Dec 9, 2024
@svrnm svrnm added the sig:rust label Dec 9, 2024
@svrnm
Copy link
Member

svrnm commented Dec 9, 2024

@open-telemetry/rust-approvers please take a look

@cijothomas
Copy link
Member

The versions are mismatched it seems. The current doc shows stdout newer version but keeps older version for api and sdk. Didn't realize that https://github.com/open-telemetry/opentelemetry.io/pull/5633/files affects the getting started docs, unfortunately:(

@TownCube updating all crates to newest would be the right fix.

@svrnm
Copy link
Member

svrnm commented Dec 11, 2024

The versions are mismatched it seems. The current doc shows stdout newer version but keeps older version for api and sdk. Didn't realize that #5633 (files) affects the getting started docs, unfortunately:(

can you point me to the lines in the documentation where the versions need to be kept in sync?

@cijothomas
Copy link
Member

https://opentelemetry.io/docs/languages/rust/getting-started/#instrumentation
opentelemetry = "0.22.0"
opentelemetry_sdk = "0.22.1"
opentelemetry-stdout = { version = "0.27.0", features = ["trace"] }

^This. If all are on 0.27.0, things would compile.

(Rust is preparing RC and 1.0 stable in a month or so, and we can come back to edit all docs here.)

@svrnm
Copy link
Member

svrnm commented Dec 11, 2024

opentelemetry = "{{% version-from-registry otel-rust %}}"
opentelemetry_sdk = "{{% version-from-registry otel-rust-sdk %}}"
opentelemetry-stdout = { version = "{{% version-from-registry exporter-rust-stdout %}}", features = ["trace"] }

they all pick the version from the registry, but currently they are not auto updated via this script:

https://github.com/open-telemetry/opentelemetry.io/blob/main/.github/workflows/scripts/update-registry-versions.sh

let me take a look if this is fixable via automation, such that they will be up-to-date as new releases are made

@svrnm
Copy link
Member

svrnm commented Dec 16, 2024

@cijothomas since #5760 is not possible until the v1.0 release we would need to track updates manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sig:rust
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants