Skip to content

init rust weblog#6675

Draft
Eldolfin wants to merge 4 commits intomainfrom
oscarld/init-rust-weblog
Draft

init rust weblog#6675
Eldolfin wants to merge 4 commits intomainfrom
oscarld/init-rust-weblog

Conversation

@Eldolfin
Copy link
Copy Markdown

@Eldolfin Eldolfin commented Apr 2, 2026

Motivation

There is no rust weblog yet so it doesn't show in the feature parity dashboard.

At this point, all tests from the TRACE_STATS_COMPUTATION scenario passes. TODO: mark all other endtoend tests as XFAIL in manifest

Changes

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?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

CODEOWNERS have been resolved as:

utils/build/docker/rust/axum.Dockerfile                                 @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/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
.github/workflows/nightly.yml                                           @DataDog/system-tests-core
.gitignore                                                              @DataDog/system-tests-core
manifests/rust.yml                                                      @DataDog/apm-rust
tests/schemas/utils/library/v0.7/config-request.json                    @DataDog/system-tests-core
utils/build/docker/rust/install_ddtrace.sh                              @DataDog/apm-rust @DataDog/system-tests-core

@Eldolfin Eldolfin changed the title wip rust weblog init rust weblog Apr 2, 2026
@Eldolfin Eldolfin requested a review from Copilot April 2, 2026 11:37
@Eldolfin
Copy link
Copy Markdown
Author

Eldolfin commented Apr 2, 2026

@codex review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces the initial Rust weblog implementation using the Axum web framework. The weblog is designed to provide OpenTelemetry tracing and metrics support for system tests, addressing the gap where no Rust implementation existed to show in the feature parity dashboard.

Changes:

  • Implements a new Rust weblog application with Axum framework supporting tracing, metrics, and multiple test endpoints (/, /healthcheck, /stats-unique, /rasp/sqli, /make_distant_call)
  • Creates Docker build infrastructure with multi-stage Dockerfile and build scripts
  • Adds "rust" to the supported languages in the library configuration schema
  • Updates Rust manifest to mark specific tests as irrelevant for the weblog variant

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/build/docker/rust/axum/src/main.rs Main Rust weblog application with OpenTelemetry integration and various test endpoints
utils/build/docker/rust/axum/Cargo.toml Rust project manifest with dependencies for Axum, tracing, and OpenTelemetry
utils/build/docker/rust/axum/Cargo.lock Dependency lock file with all transitive dependencies resolved
utils/build/docker/rust/axum.Dockerfile Multi-stage Docker build configuration for building and running the weblog
utils/build/docker/rust/axum/app.sh Entry point script for the container
utils/build/docker/rust/axum/system_tests_library_version.sh Script to extract library version from Cargo.lock
tests/schemas/utils/library/v0.7/config-request.json Schema update adding "rust" to supported languages list
manifests/rust.yml Test manifest update with specific test expectations
.gitignore Addition of Rust build artifacts to ignore list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

opentelemetry = "0.31.0"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0" }
reqwest = { version = "0.12", default-features = false }
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The reqwest dependency is configured with default-features = false, which disables essential features like TLS support. This will cause the make_distant_call endpoint (which attempts to make HTTP requests) to fail at runtime. Either enable default features or explicitly enable required features like rustls-tls or native-tls.

Suggested change
reqwest = { version = "0.12", default-features = false }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,2 @@
#!/bin/bash
grep 'name = "datadog-opentelemetry"' ./Cargo.lock -A 1 | grep -Po 'version = "\K.*?(?=")'
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The system_tests_library_version.sh script uses grep -P (Perl-compatible regular expressions), which may not be available in the minimal Debian-based image. The -P flag requires grep to be compiled with PCRE support, which is not guaranteed in slim images. Consider using a more portable approach with standard grep flags or sed.

Suggested change
grep 'name = "datadog-opentelemetry"' ./Cargo.lock -A 1 | grep -Po 'version = "\K.*?(?=")'
grep 'name = "datadog-opentelemetry"' ./Cargo.lock -A 1 | grep 'version = "' | head -n1 | sed -E 's/.*version = "([^"]+)".*/\1/'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

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

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: 744e9c9dfa

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +20 to +23
libdd-trace-utils = { path = "/binaries/libdatadog/libdd-trace-utils" }
libdd-common = { path = "/binaries/libdatadog/libdd-common" }
libdd-tinybytes = { path = "/binaries/libdatadog/libdd-tinybytes" }
libdd-telemetry = { path = "/binaries/libdatadog/libdd-telemetry" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Guard libdatadog patch paths before cargo build

Do not unconditionally patch crates.io to /binaries/libdatadog/* here, because those directories are not present in the normal system-tests build flow (the repo’s binaries/ is typically empty aside from helper files, and Rust dev setup uses rust-load-from-git/dd-trace-rs instead). With these lines present, cargo fails dependency resolution immediately with “failed to read .../Cargo.toml”, so the new rust/axum weblog image cannot build in default CI/local runs.

Useful? React with 👍 / 👎.

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 2, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1092 Tests failed

tests.ai_guard.test_ai_guard_sdk.Test_ContentParts.test_content_parts[axum] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: assert 404 == 200
 +  where 404 = HttpResponse(status_code:404, headers:{'content-length': '0', 'date': 'Fri, 03 Apr 2026 14:49:03 GMT'}, text:).status_code
 +    where HttpResponse(status_code:404, headers:{'content-length': '0', 'date': 'Fri, 03 Apr 2026 14:49:03 GMT'}, text:) = <tests.ai_guard.test_ai_guard_sdk.Test_ContentParts object at 0x7f8b47db47a0>.r

self = <tests.ai_guard.test_ai_guard_sdk.Test_ContentParts object at 0x7f8b47db47a0>

    def test_content_parts(self):
        """Test AI Guard evaluation with multi-modal content parts.
    
        Validates that prompts with content part format (text + image_url) are:
...
tests.ai_guard.test_ai_guard_sdk.Test_Evaluation.test_abort[axum] from system_tests_suite   View in Datadog   (Fix with Cursor)
assert False

self = <tests.ai_guard.test_ai_guard_sdk.Test_Evaluation object at 0x7f8b47db4200>

    def test_abort(self):
        """Test ABORT action for tool call attempting to read /etc/passwd.
        Expects 403 when blocking enabled, 200 when disabled.
        Span should have action="ABORT" and target="tool" with tool_name.
        """
        for block, request in self.r.items():
...
tests.ai_guard.test_ai_guard_sdk.Test_Evaluation.test_allow[axum] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: assert 404 == 200
 +  where 404 = HttpResponse(status_code:404, headers:{'content-length': '0', 'date': 'Fri, 03 Apr 2026 14:49:03 GMT'}, text:).status_code

self = <tests.ai_guard.test_ai_guard_sdk.Test_Evaluation object at 0x7f8b47d83ec0>

    def test_allow(self):
        """Test ALLOW action for benign weather question.
        Expects 200 status code and span with action="ALLOW" both with blocking enabled and disabled
        """
        for block, request in self.r.items():
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8467b2b | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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.

2 participants