Skip to content

feat(rust): axum weblog#7288

Open
MilanGarnier wants to merge 28 commits into
mainfrom
milan.garnier/axum-weblog
Open

feat(rust): axum weblog#7288
MilanGarnier wants to merge 28 commits into
mainfrom
milan.garnier/axum-weblog

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Motivation

Rust is lacking a weblog to run end to end tests. The goal is to provide a canonical weblog based on axum and community otel integrations.

Changes

Introduces a new Axum-based Rust weblog and wires it into the end-to-end test suite:

  • New weblog app (utils/build/docker/rust/axum/): an Axum HTTP server instrumented with dd-trace-rs, exposing the core endpoints needed by end-to-end tests (/, /healthcheck, /headers, /status, /spans, /stats-unique, /params/{value}, /sample_rate_route/{i}, /flush, /createextraservice, /e2e_otel_span, /e2e_single_span, /returnheaders, /make_distant_call, and the OTel drop-in propagator endpoints).
  • Docker build (utils/build/docker/rust/axum.Dockerfile): a multi-stage build that compiles the weblog and installs dd-trace-rs via install_ddtrace.sh, and adds the corresponding mirror image entry.
  • Manifest updates (manifests/rust.yml): mark tests that exercise endpoints or features not yet implemented in the Axum weblog or in dd-trace-rs as missing_feature/incomplete_test_app/irrelevant, while removing entries that no longer apply now that this weblog exists.
  • Deliberately keeps client_ip tagging, referer-hostname extraction,
    and query-string obfuscation unimplemented in the weblog rather than
    faking them, since those are tracer responsibilities.

⚠️ OpenTelemetry dependency resolution (open for discussion)

datadog-opentelemetry, tracing-opentelemetry,opentelemetry-instrumentation-tower and the opentelemetry* crates must all resolve to the same opentelemetry minor version, or Rust links two copies side by side and half the app silently gets a no-op tracer/propagator (no server spans, no context extraction).

install_ddtrace.sh currently enforces this at build time rather than via static Cargo.toml pins: it installs datadog-opentelemetry, inspects cargo metadata to find the OTel minor it resolved to, re-pins the other OTel/contrib crates to match, then fails the build if cargo metadata still shows more than one opentelemetry version (usually because opentelemetry-instrumentation-tower, which is git-pinned, has drifted).

This self-adjusts as dd-trace-rs moves, but it's a lot of logic standing in for what should be static dependency info, and it only fails at build time, not at edit time. Not settled — open to alternatives (vendoring/forking the tower crate, manual re-pinning).

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@datadog-official

datadog-official Bot commented Jul 10, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 1 Pipeline job failed

Testing the test | all-jobs-are-green   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 3 jobs - 3 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bf6c402 | Docs | Datadog PR Page | Give us feedback!

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/rust/axum.Dockerfile                                 @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/.gitignore                                 @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/Cargo.lock                                 @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/Cargo.toml                                 @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/app.sh                                     @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/src/integration.rs                         @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/src/main.rs                                @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/axum/system_tests_library_version.sh            @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/weblog_metadata.yml                             @DataDog/apm-rust @DataDog/system-tests-core
manifests/rust.yml                                                      @DataDog/apm-rust
mirror_images.lock.yaml                                                 @DataDog/system-tests-core
mirror_images.yaml                                                      @DataDog/system-tests-core
tests/schemas/utils/library/v0.7/config-request.json                    @DataDog/system-tests-core
tests/test_telemetry.py                                                 @DataDog/libdatadog-telemetry @DataDog/apm-sdk-capabilities @DataDog/system-tests-core
utils/build/docker/rust/install_ddtrace.sh                              @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/parametric/Cargo.lock                           @DataDog/apm-rust @DataDog/system-tests-core

@MilanGarnier MilanGarnier changed the title Milan.garnier/axum weblog feat(rust): axum weblog Jul 10, 2026
@MilanGarnier

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc1864abb4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread utils/build/docker/rust/weblog_metadata.yml
Comment thread utils/build/docker/rust/axum/src/main.rs
Comment thread utils/build/docker/rust/install_ddtrace.sh
Comment thread utils/build/docker/rust/axum/src/main.rs
Comment thread utils/build/docker/rust/axum/src/url.rs Outdated
Comment thread utils/build/docker/rust/axum.Dockerfile
Comment thread utils/build/docker/rust/axum/src/main.rs
MilanGarnier and others added 8 commits July 15, 2026 15:18
Client-IP resolution (forwarded-header priority + public-IP filtering)
and referer-hostname extraction are tracer/appsec responsibilities. The
weblog hand-rolled them, so Test_StandardTagsClientIp and
Test_StandardTagsReferrerHostname were validating the fixture rather
than dd-trace-rs. Remove the logic and mark those tests missing_feature.
Query-string obfuscation of http.url is a tracer responsibility. The
weblog's hand-rolled scrubber only served fixture-tested scrubbing cases
(all already missing_feature for Rust), so drop it entirely and report
the URL verbatim — the weblog now does near-zero tracer-side work. The
outgoing-call span still rebuilds its URL from host_str(), so userinfo
is dropped and Test_UrlField is unaffected.
@MilanGarnier
MilanGarnier requested a review from Copilot July 16, 2026 13:47

This comment was marked as resolved.

Query string obfuscation is not implemented in dd-trace-rs; the
Default::test_query_string_obfuscation_configured_server case was
missing from the manifest alongside its already-disabled siblings.
Client IP resolution (and the /waf endpoint the with-attack variant
needs) is not implemented in dd-trace-rs, matching the existing
Test_StandardTagsClientIp disablement.
@MilanGarnier
MilanGarnier marked this pull request as ready for review July 17, 2026 13:53
@MilanGarnier
MilanGarnier requested review from a team as code owners July 17, 2026 13:53
@MilanGarnier
MilanGarnier requested a review from pawelchcki July 17, 2026 13:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf6c402cf8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1,30 @@
FROM rust:1.94.1-slim-bookworm AS builder

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the new Axum weblog and its endpoints

This adds a new end-to-end weblog and multiple endpoints, but the commit does not update either docs/execute/build.md or the endpoint list in docs/understand/weblogs/README.md. .cursor/rules/end-to-end-testing.mdc explicitly requires every new weblog to be referenced in the build documentation and every new endpoint to be listed in the weblog specification, so users cannot discover the supported Rust build command or endpoint coverage from the authoritative docs.

Useful? React with 👍 / 👎.

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