Skip to content

Improve JSON component - #12086

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/ci
Jul 28, 2026
Merged

Improve JSON component#12086
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/ci

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

This PR improves the JSON component by:

  • Simplifying the writer size capability - relying on the underlying output stream size rather than introducing duplicate counting
  • Introducing mapping capabilities compatible with the existing writer API - this is not part as the writer API as the mapping as its own logic
  • Fix JSON writer usage

Motivation

Simplify the code and avoid duplicate output stream and byte array allocations.

Additional Notes

This PR is a follow up of #12052.

Contributor Checklist

Jira ticket: APMLP-1620

@PerfectSlayer
PerfectSlayer requested review from a team as code owners July 28, 2026 07:12
@PerfectSlayer
PerfectSlayer requested review from sarahchen6 and removed request for a team July 28, 2026 07:12
@PerfectSlayer PerfectSlayer added type: feature Enhancements and improvements comp: platform Platform labels Jul 28, 2026
@PerfectSlayer
PerfectSlayer requested review from ValentinZakharov and mhlidd and removed request for a team July 28, 2026 07:12

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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.

Datadog Autotest: FAIL

The payload dispatcher now serializes trace, span, and parent IDs as JSON strings even though the file format requires numeric fields, and the existing dispatcher test would reject this output. Separately, the new byte-size check reads an unflushed UTF-8 encoder buffer, so OTLP payload limits can be exceeded before the collector notices.

View proposed fix
📊 Validated against 2 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit bcd1db5 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread components/json/src/main/java/datadog/json/JsonWriter.java

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

ℹ️ 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 components/json/src/main/java/datadog/json/JsonWriter.java
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 28, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 85.45%
Overall Coverage: 57.45% (-0.24%)

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

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 28, 2026

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

Comment @DataDog to request changes

Size is now exact and do no longer need separate counting
This avoids creating intermediate writer to map collection in existing json/writter
@dd-octo-sts

dd-octo-sts Bot commented Jul 28, 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.00 s 13.96 s [-0.4%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.89 s 12.99 s [-1.4%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 16.87 s 16.81 s [-0.8%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.41 s 16.84 s [-7.0%; +1.9%] (no difference)
startup:petclinic:profiling:Agent 16.76 s 16.95 s [-2.3%; +0.1%] (no difference)
startup:petclinic:sca:Agent 16.87 s 16.49 s [+1.5%; +3.2%] (significantly worse)
startup:petclinic:tracing:Agent 16.05 s 16.02 s [-0.7%; +1.0%] (no difference)

Commit: 3db42b68 · 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.

@sarahchen6 sarahchen6 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.

Cool!

@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.

I would rename the PR to be more descriptive to the improvements.

Otherwise looks good to me

@PerfectSlayer

Copy link
Copy Markdown
Contributor Author

I would rename the PR to be more descriptive to the improvements.

Any suggestion? Because I need to keep it short for the changelog while the 3 commits address different topics 😓

@PerfectSlayer

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-28 16:34:09 UTC ℹ️ Start processing command /merge


2026-07-28 16:34:13 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-07-28 16:56:07 UTCMergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 1d5b3fb:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@PerfectSlayer

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-28 17:16:24 UTC ℹ️ Start processing command /merge


2026-07-28 17:16:29 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-07-28 18:20:23 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 1f390b7 into master Jul 28, 2026
590 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/ci branch July 28, 2026 18:20
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: platform Platform type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants