Skip to content

Upgrade OTel SDK to 0.30.0#7794

Closed
meryl-c wants to merge 157 commits intodevfrom
meryl_PULSR-1663
Closed

Upgrade OTel SDK to 0.30.0#7794
meryl-c wants to merge 157 commits intodevfrom
meryl_PULSR-1663

Conversation

@meryl-c
Copy link
Copy Markdown
Contributor

@meryl-c meryl-c commented Jul 1, 2025


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@meryl-c meryl-c requested a review from a team July 1, 2025 23:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2025

@meryl-c, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@abernix
Copy link
Copy Markdown
Member

abernix commented Jul 2, 2025

thanks for getting started on looking into this. i'm going to mark this as a draft rather than being "ready for review". It appears like it needs some work before it's ready to me, but I could be wrong. If there was something specific that you think is ready for review, could you comment back what it is? 🙇

@abernix abernix marked this pull request as draft July 2, 2025 07:01
@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Jul 2, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 12 changed, 0 removed
* graphos/routing/(latest)/configuration/overview.mdx
* graphos/routing/(latest)/configuration/envvars.mdx
* graphos/routing/(latest)/configuration/cli.mdx
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx
* graphos/routing/(latest)/operations/subscriptions/overview.mdx
* graphos/routing/(latest)/operations/subscriptions/configuration.mdx
* graphos/routing/(latest)/performance/caching/response-caching/observability.mdx
* graphos/routing/(latest)/performance/traffic-shaping.mdx
* graphos/routing/(latest)/security/jwt.mdx
* graphos/routing/(latest)/uplink.mdx
* graphos/routing/(latest)/about-v2.mdx

Build ID: ebfe35dfcbe7e461343e0b34
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/ebfe35dfcbe7e461343e0b34

@meryl-c
Copy link
Copy Markdown
Contributor Author

meryl-c commented Jul 2, 2025

@abernix thanks! I didn't even notice it wasn't a draft 😅

@meryl-c meryl-c force-pushed the meryl_PULSR-1663 branch from 6dfbe11 to c2ac121 Compare July 2, 2025 22:50
Comment thread apollo-router/Cargo.toml
opentelemetry-otlp = { version = "0.17.0", default-features = false, features = [
opentelemetry-http = "0.30.0"
opentelemetry-jaeger-propagator = "0.30.0"
opentelemetry-otlp = { version = "0.30.0", default-features = false, features = [
Copy link
Copy Markdown
Member

@goto-bus-stop goto-bus-stop Jul 3, 2025

Choose a reason for hiding this comment

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

The tonic dependency in apollo-router is just to create instances of structures for use with opentelemetry-otlp. In new versions of opentelemetry-otlp, everything we need is reexported here: https://docs.rs/opentelemetry-otlp/0.30.0/opentelemetry_otlp/tonic_types/index.html

So we can remove our tonic dependency and replace our tonic imports with use opentelemetry_otlp::tonic_types::{etc}.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

great, will do!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@goto-bus-stop @BrynCooke it doesn't export MetadataValue, which we do use:

metadata.insert("apollo.api.key", MetadataValue::try_from(apollo_key)?);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ended up upgrading tonic to 0.13.1 to fix another issue. if there's a workaround to using MetadataValue, I'm happy to do that instead and remove tonic

@meryl-c
Copy link
Copy Markdown
Contributor Author

meryl-c commented Jul 3, 2025

currently stuck because when I was removing versioned_meter everywhere, I came across
impl MeterProvider for AggregateMeterProvider {...}
which does not override meter_with_scope and I wasn't sure how to proceed

Comment thread apollo-router/src/executable.rs Outdated
Comment thread apollo-router/src/metrics/aggregation.rs Outdated
Comment thread apollo-router/src/plugins/telemetry/otel/named_runtime_channel.rs Outdated
Also moves with_filter logic directly into fmt_layer to avoid tracing reload bug
Comment on lines +204 to +217
fn strip_noisy_otel_shutdown_logs(s: &str) -> String {
let had_trailing_newline = s.ends_with('\n');
let filtered = s
.lines()
.filter(|line| if line.trim().contains(r#""name":"MeterProvider.Drop""#) { false } else { true } )
.collect::<Vec<_>>()
.join("\n");
if had_trailing_newline && !filtered.is_empty() {
format!("{filtered}\n")
} else {
filtered
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This probably isn't the best long term. I wonder if this is actually due the ReemitOtelLayer not going through the regular tracing layers? Otherwise perhaps it would be muted?

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.

6 participants