Skip to content

[NO-TICKET] ActionController - Honor resource override - #6280

Open
vpellan wants to merge 1 commit into
masterfrom
vpellan/active-record-honor-resource-override
Open

[NO-TICKET] ActionController - Honor resource override#6280
vpellan wants to merge 1 commit into
masterfrom
vpellan/active-record-honor-resource-override

Conversation

@vpellan

@vpellan vpellan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Honor resource override in ActionController

Motivation:

Internal support

Change log entry

Yes. Preserve custom trace resource names for ActionController requests.

Additional Notes:

How to test the change?

@vpellan
vpellan requested review from a team as code owners September 3, 2026 14:22
@vpellan
vpellan requested review from mabdinur and marcotc September 3, 2026 14:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 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-09-03T14:24:45.998111Z 0aa1612 PR opened
🔒 Security Review Completed 2026-09-03T14:25:48.658520Z 0aa1612 PR opened
ℹ️ 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.

@dd-octo-sts dd-octo-sts Bot added integrations Involves tracing integrations tracing labels Sep 3, 2026
@datadog-official

datadog-official Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0aa1612 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Sep 3, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-03 15:12:35

Comparing candidate commit 0aa1612 in PR branch vpellan/active-record-honor-resource-override with baseline commit 0198684 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 51 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:tracing - Tracing.continue_trace!

  • unstable throughput [-1334.296op/s; +2561.446op/s] or [-3.501%; +6.720%]

begin
# We repeat this in both start and at finish because the resource may have changed during the request
trace.resource = span.resource unless payload[:headers][:request_exception]
if trace.resource == tracing_context[:dd_request_trace_resource] && !payload[:headers][:request_exception]

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.

Could we also treat !trace.resource_override? as eligible here? TraceOperation defines trace.resource = nil as clearing the override, but this equality then fails and Rack falls back to its generic resource.
A small spec for that transition plus !trace.resource_override? || ... would preserve the existing no-override behavior.

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

The resource-ownership approach matches the existing Rack precedence, and the tests cover overrides both before controller start and during request processing. I left one non-blocking edge-case note.

@TonyCTHsu TonyCTHsu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. The pull request description does not explain why.
  2. Changing resource has been risky because of backward compatibility, please elaborate how this change impact customers.

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

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants