Skip to content

chore(ai-guard): enable event tag in node#6779

Open
manuel-alvarez-alvarez wants to merge 1 commit intomainfrom
malvarez/ai-guard-event-tag-manifest
Open

chore(ai-guard): enable event tag in node#6779
manuel-alvarez-alvarez wants to merge 1 commit intomainfrom
malvarez/ai-guard-event-tag-manifest

Conversation

@manuel-alvarez-alvarez
Copy link
Copy Markdown
Member

@manuel-alvarez-alvarez manuel-alvarez-alvarez commented Apr 21, 2026

Motivation

Support for the event tag on the root span has been added in Node.js.

Changes

Enable the corresponding test in Node.js.

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?

@manuel-alvarez-alvarez manuel-alvarez-alvarez force-pushed the malvarez/ai-guard-event-tag-manifest branch from 3c38352 to 2b8e2e1 Compare April 21, 2026 12:59
@github-actions
Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/nodejs.yml                                                    @DataDog/dd-trace-js

@manuel-alvarez-alvarez manuel-alvarez-alvarez marked this pull request as ready for review April 21, 2026 12:59
@datadog-prod-us1-3
Copy link
Copy Markdown
Contributor

datadog-prod-us1-3 Bot commented Apr 21, 2026

Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1 Test failed

tests.ai_guard.test_ai_guard_sdk.Test_AIGuardEvent_Tag.test_ai_guard_event[express4] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: Expected ai_guard.event to be set on root span, but it was not (meta: {'_dd.tags.process': 'entrypoint.basedir:app,entrypoint.name:app,entrypoint.type:script,entrypoint.workdir:app,package.json.name:express,svc.user:true', '_dd.p.tid': '69e7766000000000', '_dd.p.dm': '-13', 'key1': 'val1', 'key2': 'val2', 'service': 'weblog', 'env': 'system-tests', 'version': '1.0.0', 'runtime-id': '8b0e5abe-7fae-4a35-9ac6-0233390b1947', '_dd.rc.client_id': 'b8aca651-ae69-4409-98c4-3159675f1039', 'component': 'express', 'span.kind': 'server', 'http.url': 'http://localhost:7777/ai_guard/evaluate', 'http.method': 'POST', 'http.useragent': 'system_tests rid/PAYDTLGQCWBXXCJVBLKLBQYTNGUNPLVMXFRS', 'http.request.headers.user-agent': 'system_tests rid/PAYDTLGQCWBXXCJVBLKLBQYTNGUNPLVMXFRS', '_dd.code_origin.type': 'entry', '_dd.code_origin.frames.0.file': '/usr/app/app.js', '_dd.code_origin.frames.0.line': '757', '_dd.code_origin.frames.0.column': '5', '_dd.code_origin.frames.0.method': '<anonymous>', '_dd.code_origin.frames.0.type': 'Object', 'http.route': '/ai_guard/evaluate', 'http.status_code': '200', '_dd.integration': 'express', 'language': 'javascript'})
assert False

self = <tests.ai_guard.test_ai_guard_sdk.Test_AIGuardEvent_Tag object at 0x7f03785e2b10>

    def test_ai_guard_event(self):
        """Test AI Guard sets ai_guard.event:true tag in the local root span of the trace."""
        assert self.r.status_code == 200
>       interfaces.library.validate_one_trace(self.r, validator=self._assert_trace)

...

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM with the change (we released a new version in-between)

Comment thread manifests/nodejs.yml
tests/ai_guard/test_ai_guard_sdk.py::Test_AIGuardEvent_Tag:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
express4: *ref_5_98_0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
express4: *ref_5_98_0
express4: *ref_5_99_0

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