Skip to content

Update AggregateEntry to Fit OTLP Trace Metrics Keys#11719

Open
mhlidd wants to merge 8 commits into
masterfrom
mhlidd/otlp_trace_metrics_aggregate_entry
Open

Update AggregateEntry to Fit OTLP Trace Metrics Keys#11719
mhlidd wants to merge 8 commits into
masterfrom
mhlidd/otlp_trace_metrics_aggregate_entry

Conversation

@mhlidd

@mhlidd mhlidd commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

This PR updates AggregateEntry to properly be able to capture separate counts for OK and Error latencies, as well as properly capturing the entire origin span tag, rather than just the original boolean of whether origin == synthetic. As part of this refactor, all helper tests also account for origin as a String object rather than a boolean tracking synthetic.

Native CSS path still only checks whether origin == synthetic, while OTLP will use the full origin value.

Motivation

Additional Notes

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@dd-octo-sts

dd-octo-sts Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

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 13.94 s 13.95 s [-0.6%; +0.5%] (no difference)
startup:insecure-bank:tracing:Agent 12.96 s 12.94 s [-0.7%; +0.9%] (no difference)
startup:petclinic:appsec:Agent 16.83 s 17.26 s [-6.9%; +1.9%] (no difference)
startup:petclinic:iast:Agent 16.63 s 17.47 s [-8.8%; -0.8%] (maybe better)
startup:petclinic:profiling:Agent 17.51 s 17.39 s [-0.3%; +1.6%] (no difference)
startup:petclinic:sca:Agent 17.50 s 17.38 s [-0.6%; +1.9%] (no difference)
startup:petclinic:tracing:Agent 16.57 s 16.68 s [-1.5%; +0.3%] (no difference)

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

Base automatically changed from mhlidd/otlp_trace_metrics_config to master June 24, 2026 18:09
@mhlidd mhlidd changed the title init Update AggregateEntry to Fit OTLP Trace Metrics Keys Jun 24, 2026
@mhlidd mhlidd added type: enhancement Enhancements and improvements type: refactoring comp: metrics Metrics labels Jun 24, 2026
@mhlidd mhlidd marked this pull request as ready for review June 24, 2026 18:12
@mhlidd mhlidd requested a review from a team as a code owner June 24, 2026 18:12
@mhlidd

mhlidd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 3be9e267af

ℹ️ 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".

String[] snapshotNames = s.peerTagSchema == null ? null : s.peerTagSchema.names;
return httpStatusCode == s.httpStatusCode
&& synthetic == s.synthetic
&& contentEquals(origin, s.origin)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid keying native stats by arbitrary origin

When the current/native metrics path is used, SerializingMetricWriter.add still serializes only the derived Synthetics boolean and never the full origin, so adding the full origin to the AggregateEntry match/hash makes non-synthetic origins such as rum, ciapp-test, or user-supplied _dd.origin values occupy separate aggregate slots even though they produce identical msgpack keys. A workload receiving many distinct origins can now exhaust maxAggregates and drop client stats; keep this split to the OTLP writer/table or normalize the native key back to the synthetics boolean.

Useful? React with 👍 / 👎.

@dougqh

dougqh commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I'm 75% through reworking this code. I'm trying to decide how best to slot this in.
The last major structural change is #11387. It adds per component / tag cardinality limiters, and it looks that is going to interact with this.

@mhlidd

mhlidd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@dougqh Happy to get this PR to a mergable state and wait to merge after your changes go in. I took a quick look and it doesn't look like your PR introduces anything that would logically prevent my changes from working. Would you be able to confirm that? 🙇‍♂️

@dougqh

dougqh commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@dougqh Happy to get this PR to a mergable state and wait to merge after your changes go in. I took a quick look and it doesn't look like your PR introduces anything that would logically prevent my changes from working. Would you be able to confirm that? 🙇‍♂️

@mhlidd Yeah, after thinking it through, I'd like to land #11387 first -- precisely because it gives us a safety mechanism that is important there.

Because origin is externally controlled, I want to be careful how we handle it. Right now, the DDCache can constantly churn, so an external actor can still cause constant UTF8BytesString allocation.

#11387 introduces a cardinality limiter that allows us to clamp allocation, so blunt that attack vector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: metrics Metrics type: enhancement Enhancements and improvements type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants