Skip to content

Register Data Jobs Monitoring tags on Spark span types (tag registry rollout) - #13191

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
dougqh/tag-registry-djm
Nov 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
dougqh/tag-registry-djm

Conversation

@dougqh

@dougqh dougqh commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Registers the tags Data Jobs Monitoring sets on Spark spans in the tag registry, so the Spark instrumentation can later set them by id. These are the largest group of tags that are set as string literals and aren't registered: 99 of 155 such keys, and 138 of 221 call sites.

DJM is Java only, so everything goes in the Java overlay (tag-conventions-java.yaml). Each tag is placed on the span types its set sites actually reach:

  • spark (abstract, extends internal): app_id and service_name, set on every driver span by buildSparkSpan.
  • spark.task_metrics (abstract): the 23 per-task metrics, set by the executor on one task or by the driver as a sum over many (spark.executor_run_time, spark.shuffle_read_bytes, ...).
  • spark.aggregate (abstract): what only the driver's sums carry. That's the task counts, spark.available_executor_time, spark.skew_time, and the base64 _dd.spark.* histograms.
  • Driver span types, each extending spark.aggregate:
    • spark.application: app name, user, OpenLineage parent, EMR step, config.spark_version / config.spark_serializer.
    • spark.sql
    • spark.job
    • spark.stage: includes the stage's SQL plan.
    • spark.streaming_batch: streaming query ids and progress metrics.
  • spark.task (the driver's view of a finished task) and spark.executor.task (the executor's span). They share task_id, stage_id and so on by ref.
  • spark.launcher: the SparkLauncher launch span.
  • databricks mixin, applied to spark.job and spark.streaming_batch: the Databricks job, job-run and task-run ids. On Databricks the top-level span is a job or a streaming batch, because there's no application span. This is the overlay's first mixin.

Motivation

The id migration needs every tag registered. The registry already covers every tag constant. String literals are the next layer, and DJM's are about two thirds of them.

Additional Notes

  • Not modeled: name patterns. These can't have ids:
    • the config.* job and app parameters (two fixed members, config.spark_version and config.spark_serializer, are registered, following the http.request.headers.* precedent)
    • streaming progress, spark.source.<n>.* and spark.state.<n>.*
    • runtime tags copied from job properties
    • the launcher's config.*
  • Slots. 104 new tags. SLOT_COUNT stays at 63. spark.application and spark.streaming_batch exceed 63 tags, so some of their optional tags share slots (21 new sharers). Every other Spark type, and every APM span type, stays exact.
  • One java_names entry. With Name KnownTags ids after their tags and fail on constant clashes (tag registry rollout) #13061's bare ids, service_name's id would be SERVICE_NAME, which is service's name constant, so generation fails on the clash. It gets the base SPARK_SERVICE_NAME instead (id SPARK_SERVICE_NAME, name SPARK_SERVICE_NAME_NAME). No existing constant changes.
  • Registry only. The Spark instrumentation still sets these tags by name. Moving it to ids is a follow-up.
  • Tests: KnownTagsTest, TagConstantsRegistryCoverageTest, KnownTagCodecSlotTest, and the TagMap by-id tests pass locally.

🤖 Generated with Claude Code

@dougqh dougqh added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring inst: apache spark Apache Spark instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Nov 3, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.99% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0954bf2 | Docs | Give us feedback!

@dougqh dougqh changed the title Register Data Jobs Monitoring tags on Spark span types (otlp - tag registry) Register Data Jobs Monitoring tags on Spark span types (tag registry rollout) Nov 3, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.07 s 13.99 s [-0.2%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 12.96 s 12.95 s [-0.7%; +0.9%] (no difference)
startup:petclinic:appsec:Agent 17.73 s 17.49 s [+0.5%; +2.2%] (maybe worse)
startup:petclinic:iast:Agent 17.57 s 17.59 s [-1.0%; +0.8%] (no difference)
startup:petclinic:profiling:Agent 17.51 s 17.46 s [-1.1%; +1.6%] (no difference)
startup:petclinic:sca:Agent 17.81 s 17.76 s [-0.6%; +1.2%] (no difference)
startup:petclinic:tracing:Agent 16.62 s 16.76 s [-2.0%; +0.4%] (no difference)

Commit: 0954bf22 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@dougqh
dougqh marked this pull request as ready for review November 3, 2026 22:03
@dougqh
dougqh requested review from a team as code owners November 3, 2026 22:03
@dougqh
dougqh requested review from bric3 and cecile75 and removed request for a team November 3, 2026 22:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T22:10:16.461127Z 4e9f320 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 4e9f32017c

ℹ️ 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 tag-conventions-java.yaml Resolved

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

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.

Bits Code Review: FAIL

Databricks SQL spans set three Databricks IDs and config.spark_version, but their new registry definition omits all four. This leaves the resolved tag set and co-occurrence model incomplete; existing string-based tagging remains unaffected.

Open Bits AI session

🤖 Bits Code Review · Commit 4e9f320

Comment thread tag-conventions-java.yaml Resolved
dougqh and others added 3 commits November 6, 2026 13:23
DJM is Java only, so its span types go in the Java overlay: an abstract
spark / spark.task_metrics / spark.aggregate chain, the driver's
application, sql, job, stage, streaming batch and task spans, the
executor's task span, the launcher span, and a databricks mixin for the
top-level span on Databricks. Name patterns (config.*, spark.source.N.*,
spark.state.N.*, copied runtime tags) stay unregistered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Databricks a SQL execution can be the top-level span, and
getOrCreateSqlSpan adds the Databricks ids and config.spark_version to
it, as it does for jobs and streaming batches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With ids bare, service_name's id would be SERVICE_NAME, which is
service's name constant, so generation fails on the clash. Its
constants are SPARK_SERVICE_NAME / SPARK_SERVICE_NAME_NAME instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dougqh
dougqh force-pushed the dougqh/tag-registry-djm branch from 40b70f1 to 6a7fbde Compare November 6, 2026 18:30

@bric3 bric3 left a comment

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.

No blocking findings. The registry preserves Spark's existing tag names.

  • Downstream naming contracts: databricks_job_id, databricks_job_run_id and databricks_task_run_id match the exact keys exempted from credit-card obfuscation in the Agent and libdatadog.
  • Names with different meanings: Spark's service_name remains separate from service and its OpenTelemetry name service.name. SPARK_SERVICE_NAME changes only the generated Java identifier. Existing spellings, including spark.query_planing_duration, are preserved.
  • Shared product conventions: Python's Ray instrumentation also sets _dd.djm.enabled = 1, so the Java-only statement should refer specifically to these Spark span types. The inline wording suggestion is non-blocking.

Comment thread tag-conventions-java.yaml Resolved
Comment thread tag-conventions-java.yaml Resolved
…claim

Only stage metrics take tasks' values into their histograms; the job,
application and streaming batch spans sum their stages' metrics without
merging the histograms, so those six tags only ever appear on stages.
Python's Ray instrumentation also sets _dd.djm.enabled, so the comment
now says these Spark spans come from the Java tracer, not that DJM is
Java only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dougqh

dougqh commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-16 13:28:09 UTC ℹ️ Start processing command /merge


2026-11-16 13:28:16 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-11-16 14:31:10 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-11-16 15:34:08 UTC ℹ️ MergeQueue: This merge request was merged

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

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.

Bits Code Review: PASS

More details

The Spark tag registrations preserve existing emitted names, and static checks confirmed unique generated constant names and valid slot assignments.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 0954bf2

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 1ad5b90 into master Nov 16, 2026
683 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/tag-registry-djm branch November 16, 2026 15:34
@github-actions github-actions Bot added this to the 1.70.0 milestone Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core inst: apache spark Apache Spark instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants