Skip to content

Fixup telemetry schema discrepancies - #7417

Merged
bwoebi merged 3 commits into
mainfrom
bob/telemetry-schema
Jul 31, 2026
Merged

Fixup telemetry schema discrepancies#7417
bwoebi merged 3 commits into
mainfrom
bob/telemetry-schema

Conversation

@bwoebi

@bwoebi bwoebi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Telemetry schema: validate the envelope at the request root, not under a header property. The
envelope is flat and no payload has ever had a header key, so the whole header went unvalidated
for every library. Gated on application being present so agent-metrics/agent-bsod and
apm-onboarding-event keep their own header shape.

Fix message-batch: every branch put payload outside properties (an ignored keyword) and applied
object schemas to an array, so nested events were never validated - i.e. most telemetry, since
tracers send it batched. Same for the v2 request_type enum. Both now shared via
v2/objects/{request_type,payload_dispatch}.json.

Accept null alongside the declared type for the optional leaf fields: the intake is omitempty and treats null and
absent alike.

Add schemas for sketches and app-endpoints, which had no branch at all (note app-endpoints' kebab-
case is-first, the key the intake decodes).

Align strictness with the intake: mark a bunch of fields as not optional.

This solves the APMAPI-1938 and APMAPI-1270 SchemaBugs, which were bugs in the schema, not actual backend schema violations.

Adding a bunch of new schema bugs due to not validated message-batch.

@bwoebi
bwoebi requested a review from a team as a code owner July 29, 2026 19:00
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/schemas/utils/miscs/telemetry/common/events/sketches.json         @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/events/app-endpoints.json        @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/payload_dispatch.json    @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/request_type.json        @DataDog/system-tests-core
tests/appsec/test_asm_standalone.py                                     @DataDog/asm-libraries @DataDog/system-tests-core
tests/schemas/test_schemas.py                                           @DataDog/system-tests-core
tests/schemas/utils/library/telemetry/proxy/api/v2/apmtelemetry-request.json  @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/events/distributions.json    @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/events/generate-metrics.json  @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/dependency.json      @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/error.json           @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/integration.json     @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/logs.json            @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/metric.json          @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/metric_with_namespace.json  @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/product.json         @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/products.json        @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/common/objects/remote_config.json   @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v1/objects/header.json              @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v1/telemetry_request.json           @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/events/app-started.json          @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/events/client-configuration-change.json  @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/events/message-batch.json        @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/application.json         @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/configuration.json       @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/header.json              @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/objects/host.json                @DataDog/system-tests-core
tests/schemas/utils/miscs/telemetry/v2/telemetry_request.json           @DataDog/system-tests-core

@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: a066039489

ℹ️ 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 thread tests/schemas/utils/miscs/telemetry/v2/telemetry_request.json
@datadog-official

datadog-official Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@bwoebi
bwoebi force-pushed the bob/telemetry-schema branch 3 times, most recently from 6118830 to 355fa81 Compare July 30, 2026 13:17
Telemetry schema: validate the envelope at the request root, not under a `header` property. The
envelope is flat and no payload has ever had a `header` key, so the whole header went unvalidated
for every library. Gated on `application` being present so agent-metrics/agent-bsod and
apm-onboarding-event keep their own header shape.

Fix message-batch: every branch put `payload` outside `properties` (an ignored keyword) and applied
object schemas to an array, so nested events were never validated - i.e. most telemetry, since
tracers send it batched. Same for the v2 `request_type` enum. Both now shared via
v2/objects/{request_type,payload_dispatch}.json.

Accept null alongside the declared type for the optional leaf fields: the intake is omitempty and treats null and
absent alike.

Add schemas for sketches and app-endpoints, which had no branch at all (note app-endpoints' kebab-
case `is-first`, the key the intake decodes).

Align strictness with the intake: mark a bunch of fields as not optional.

This solves the APMAPI-1938 and APMAPI-1270 SchemaBugs, which were bugs in the schema, not actual backend schema violations.

Adding a bunch of new schema bugs due to not validated message-batch
@bwoebi
bwoebi force-pushed the bob/telemetry-schema branch from 355fa81 to 650457e Compare July 30, 2026 16:58
@bwoebi
bwoebi requested a review from a team as a code owner July 31, 2026 01:35
@bwoebi
bwoebi merged commit a502326 into main Jul 31, 2026
1376 of 1378 checks passed
@bwoebi
bwoebi deleted the bob/telemetry-schema branch July 31, 2026 15:29
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