Skip to content

feat(runtime): refresh MicroVM identity - #19939

Open
litianningdatadog wants to merge 1 commit into
tianning.li/2-wsgi-asgi-integrationfrom
tianning.li/3-wsgi-asgi-integration-based-refresh
Open

litianningdatadog wants to merge 1 commit into
tianning.li/2-wsgi-asgi-integrationfrom
tianning.li/3-wsgi-asgi-integration-based-refresh

Conversation

@litianningdatadog

@litianningdatadog litianningdatadog commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked PRs:

Description

This PR owns the MicroVM policy for the generic request-start event published
by PR #19898. At ddtrace initialization it registers
maybe_refresh_identity only when in_aws_lambda_microvm() is true. The
listener also guards direct registration outside a MicroVM.

maybe_refresh_identity matches only POST /aws/lambda-microvms/runtime/v1/run,
then refreshes the runtime identity once per transition. The refresh lock,
pending-callback state, and retry behavior remain in the runtime-ID
implementation.

When a refresh callback fails, the transition still runs the remaining pending
callbacks and then re-raises the first error. Failed callbacks stay pending, so
the next observation retries only those against the same refreshed identity.
Previously the first failure stopped the loop, so a callback that failed on every
retry also blocked every callback queued behind it. This applies only to the
MicroVM pending queue; direct refresh_identity() callers and the non-raising
path keep their existing behavior.

The generic publisher dispatches without allow_raise, so refresh callback
failures do not fail the lifecycle request. The refresh state still leaves failed
callbacks pending, allowing the next observation to retry against the same
refreshed identity.

This completes the MicroVM side of review comment r4146791727.

Reference

Testing

  • focused ASGI MicroVM request-start test: 8 passed
  • focused runtime-ID listener, matching, and retry tests: 9 passed
  • new: a persistently failing callback does not starve later callbacks, and is retried alone
  • new: with several failures, the first error propagates and every failed callback stays pending
  • new: direct refresh_identity(raise_on_error=True) still stops at the first failure
  • tests/tracer/runtime/test_runtime_id.py: 39 passed (Python 3.12); the first two new tests fail
    without the change; detect_global_locks passed
  • focused WSGI listener-error isolation test: 1 passed (Python 3.12)
  • git diff --check

Risks

Runtime identity refresh changes only for the MicroVM /run lifecycle request.
No listener is registered in non-MicroVM processes.
The error-deferral change is keyed on the MicroVM pending queue, which only
maybe_refresh_identity supplies, and that function returns immediately outside a
MicroVM.

🤖 Generated with Claude Code

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

📈 Existing violations got worse

4 pre-existing violation(s) increased in severity (e.g. their target became more depended-on, or got pulled into an import cycle), though the edge itself isn't new:

ddtrace.contrib.internal.subprocess.patch -×-> ddtrace.internal.runtime  (contrib -> product:runtime, score=8, +1 vs base)
ddtrace.internal.ci_visibility.writer -×-> ddtrace.internal.runtime  (product:ci_visibility -> product:runtime, score=7, +1 vs base)
ddtrace.debugging._probe.status -×-> ddtrace.internal.runtime  (product:debugging -> product:runtime, score=7, +1 vs base)
ddtrace._trace.tracer -×-> ddtrace.internal.runtime  (product:tracing -> product:runtime, score=7, +1 vs base)

⚠️ Existing dependency direction violations

There are 201 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 201 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=132)
ddtrace.debugging._exception.replay -×-> ddtrace.trace  (product:debugging -> product:tracing, score=130)
ddtrace.profiling.collector.pytorch -×-> ddtrace.trace  (product:profiling -> product:tracing, score=130)
ddtrace.llmobs._integrations.langchain -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)
ddtrace.llmobs._integrations.mcp -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 1 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against tianning.li/2-wsgi-asgi-integration using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

ddtrace/__init__.py                                                     @DataDog/python-guild
ddtrace/internal/_runtime_id.py                                         @DataDog/apm-core-python
ddtrace/internal/constants.py                                           @DataDog/apm-core-python
ddtrace/internal/runtime/__init__.py                                    @DataDog/apm-sdk-capabilities-python
ddtrace/internal/serverless/__init__.py                                 @DataDog/apm-core-python
releasenotes/notes/aws-lambda-microvm-identity-refresh-3a672cd6bcbad16d.yaml  @DataDog/apm-python
tests/contrib/asgi/test_asgi.py                                         @DataDog/python-guild @DataDog/apm-idm-python
tests/contrib/wsgi/test_wsgi.py                                         @DataDog/python-guild @DataDog/apm-idm-python
tests/tracer/runtime/test_runtime_id.py                                 @DataDog/apm-sdk-capabilities-python

@pr-commenter

pr-commenter Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-10-02 01:55:23

Comparing candidate commit 25e8bb8 in PR branch tianning.li/3-wsgi-asgi-integration-based-refresh with baseline commit 1e76b73 in branch tianning.li/2-wsgi-asgi-integration.

📊 Benchmarking dashboard

Found 0 performance improvements and 6 performance regressions! Performance is the same for 561 metrics, 10 unstable metrics, 7 known flaky benchmarks, 17 flaky benchmarks without significant changes.

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 ----------------------------------'

scenario:httppropagationextract-b3_headers

  • 🟥 execution_time [+919.138ns; +997.115ns] or [+12.157%; +13.189%]

scenario:iastaspects-format_map_noaspect

  • 🟥 execution_time [+95.806µs; +102.765µs] or [+26.563%; +28.492%]

scenario:iastaspectsremodule-re_expand_aspect

  • 🟥 execution_time [+75.967µs; +87.138µs] or [+11.950%; +13.707%]

scenario:msgpackencoderscenario-simple_one_span

  • 🟥 execution_time [+504.574ns; +573.011ns] or [+12.366%; +14.043%]

scenario:otelspan-start

  • 🟥 execution_time [+1.852ms; +2.677ms] or [+7.552%; +10.915%]

scenario:recursivecomputation-shallow

  • 🟥 execution_time [+56.385µs; +60.504µs] or [+8.057%; +8.645%]

Unstable benchmarks

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

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-719.334ns; +750.733ns] or [-6.905%; +7.207%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-38.825ns; +39.519ns] or [-5.849%; +5.953%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1926.643ns; +1892.875ns] or [-9.715%; +9.545%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1932.630ns; +1735.183ns] or [-10.177%; +9.137%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-373.584ns; +388.479ns] or [-8.828%; +9.180%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-227.541ns; +230.745ns] or [-8.547%; +8.667%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-108.414ns; +76.068ns] or [-7.973%; +5.594%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-4851.827ns; +4346.918ns] or [-10.063%; +9.016%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-1017.269ns; +902.751ns] or [-9.918%; +8.802%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-51.518µs; +56.289µs] or [-9.140%; +9.986%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.768µs; +2.883µs] or [+19.327%; +20.129%]

scenario:iastaspects-title_noaspect

  • 🟥 execution_time [+31.806µs; +36.209µs] or [+15.503%; +17.649%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+145.070µs; +149.880µs] or [+39.397%; +40.703%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+20.731µs; +23.748µs] or [+12.658%; +14.500%]

scenario:span-start

  • 🟥 execution_time [+1.312ms; +1.748ms] or [+10.592%; +14.111%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+270.899ns; +305.043ns] or [+14.315%; +16.119%]

scenario:tracer-small

  • 🟥 execution_time [+41.165µs; +42.352µs] or [+16.962%; +17.451%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-casefold_noaspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-rstrip_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-translate_aspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

Copilot AI 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.

Pull request overview

This PR wires AWS Lambda MicroVM “/run” lifecycle detection into ddtrace startup so the runtime identity can be refreshed after import-time when a MicroVM reuses the same Python process for a new logical runtime.

Changes:

  • Adds a MicroVM /run request listener (web.request.starting) that refreshes runtime identity once per process, with a forksafe/threadsafe guard.
  • Centralizes MicroVM /run method/path constants and reuses them from the contrib web dispatch helper.
  • Adds subprocess + integration test coverage to ensure refresh happens before root span creation and is thread-safe.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ddtrace/internal/runtime/__init__.py Adds MicroVM /run hook constants and request-event listener that refreshes identity once per process.
ddtrace/__init__.py Registers the MicroVM identity-refresh hook during ddtrace import.
ddtrace/contrib/internal/web.py Uses the shared MicroVM /run constants when dispatching web.request.starting.
ddtrace/contrib/_events/web_framework.py Minor formatting-only change.
tests/tracer/runtime/test_runtime_id.py Adds focused subprocess tests for hook registration behavior, matching logic, ordering vs. root span, thread-safety, and fork reset.
tests/contrib/asgi/test_asgi.py Adds ASGI integration coverage that /run refreshes identity exactly once.
tests/contrib/wsgi/test_wsgi.py Adds WSGI integration coverage that /run refreshes identity exactly once.
releasenotes/notes/aws-lambda-microvm-identity-refresh-3a672cd6bcbad16d.yaml Adds a release note entry for the MicroVM identity refresh feature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread releasenotes/notes/aws-lambda-microvm-identity-refresh-3a672cd6bcbad16d.yaml Outdated
Comment thread ddtrace/__init__.py Outdated
@litianningdatadog litianningdatadog added the aws-microvm Work related to AWS MicroVM onboarding label Aug 31, 2026
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch from 2593fa8 to 4aebb33 Compare September 3, 2026 20:25
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch from 73d9d64 to 53a921c Compare September 3, 2026 20:25
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch from 4aebb33 to 206cd22 Compare September 3, 2026 20:32
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch from 53a921c to 7b4a217 Compare September 3, 2026 20:37
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch from 206cd22 to f3ea773 Compare September 3, 2026 20:47
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch 2 times, most recently from 2c58627 to 99e2b4e Compare September 4, 2026 15:10
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch from f3ea773 to 68bf61e Compare September 4, 2026 15:37
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch 2 times, most recently from 676adf4 to 18c03c4 Compare September 4, 2026 15:43
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch 2 times, most recently from 8e26c22 to cdc53d4 Compare September 4, 2026 16:39
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch 4 times, most recently from 6e5799f to 75def6a Compare September 4, 2026 20:44
@litianningdatadog
litianningdatadog requested review from a team as code owners September 24, 2026 16:18
@litianningdatadog
litianningdatadog requested review from avara1986, clifordshelton and duncanpharvey and removed request for a team September 24, 2026 16:18
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch from 0d2b84e to 988ed14 Compare September 24, 2026 16:58
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch 2 times, most recently from bfe3d91 to a44c5ce Compare September 25, 2026 15:50
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch from 988ed14 to 81e11ca Compare September 25, 2026 15:57
@litianningdatadog
litianningdatadog force-pushed the tianning.li/2-wsgi-asgi-integration branch from a44c5ce to 7398b18 Compare September 25, 2026 21:40
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch 2 times, most recently from 01e37a4 to 3bb8821 Compare September 25, 2026 22:15
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Sep 28, 2026
Stacked PRs:
- 👉 This #19778 — runtime identity foundation
  - #19898 — WSGI/ASGI request-start hook
    - #19939 — central MicroVM /run identity refresh
      - #19820 — tracer/native writer exporter refresh
        - #19821 — telemetry worker refresh
          - #19822 — runtime metrics runtime-id tags

## Description

Adds `ddtrace.internal.runtime.refresh_identity()` for runtimes that need a fresh runtime ID without going through an OS fork.

This introduces `on_runtime_identity_refresh()`, a dedicated callback registry for consumers that should react only to explicit identity refreshes. Existing `on_runtime_id_change()` behavior remains available for fork-related and general runtime-ID change handling.

`refresh_identity()` rotates the runtime ID without recording parent or ancestor lineage because a resumed MicroVM run is not a real fork. Existing fork behavior and lineage tracking remain unchanged.

Refresh callbacks are isolated by default so one failed consumer does not block others. Callers coordinating a refresh transaction can opt into error propagation with `raise_on_error=True` and retry the same identity refresh when a rebuild fails.

## Reference

- [RFC](https://docs.google.com/document/d/17lde4Zak2YRBuDvf32KFanXj9TdpOv24GYaEY8swA1w/edit?tab=t.0#heading=h.wwu37decnk8j)

## Testing

Added coverage for:

- runtime ID rotation through `refresh_identity()`
- preservation of parent and ancestor fork lineage
- explicit refresh subscriber notification
- refresh subscribers not being invoked by fork handling
- callback failure isolation by default
- optional refresh callback failure propagation
- successful callbacks under `raise_on_error=True`

Validation:

- `scripts/run-tests -s --venv 190fcc7 -- -q tests/tracer/runtime/test_runtime_id.py` — 21 passed
- `scripts/lint checks` — passed

## Risks

Low. The new path is opt-in and is not wired to traffic in this PR. Existing fork behavior is preserved.


Co-authored-by: tianning.li <tianning.li@datadoghq.com>
@litianningdatadog
litianningdatadog force-pushed the tianning.li/3-wsgi-asgi-integration-based-refresh branch 2 times, most recently from 60390da to 3b930a9 Compare September 29, 2026 02:07
Comment thread ddtrace/internal/runtime/__init__.py Outdated

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

Deferring review because the base branch is not main

@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: 875cd07953

ℹ️ 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 ddtrace/internal/_runtime_id.py Outdated

@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: 1ec6286041

ℹ️ 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/contrib/wsgi/test_wsgi.py Outdated

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

ℹ️ 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 ddtrace/internal/_runtime_id.py

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

ℹ️ 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 ddtrace/contrib/internal/web.py Outdated
Comment thread ddtrace/contrib/internal/web.py Outdated

@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: 09ba3d964b

ℹ️ 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/tracer/runtime/test_runtime_id.py Outdated

@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: 1063bc02b4

ℹ️ 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 ddtrace/internal/_runtime_id.py
Comment thread ddtrace/internal/_runtime_id.py Outdated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@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: 25e8bb8778

ℹ️ 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 on lines +111 to +114
if first_error is None:
first_error = e
else:
log.exception("Runtime ID callback %r failed and stays pending", cb)

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 Log the first deferred refresh failure

When a refresh subscriber fails in production, this branch saves the first exception without logging it and later re-raises it; however, the /run publisher calls core.dispatch() without allow_raise, and the native event hub silently suppresses ordinary exceptions when the default config._raise=False. With a single failing subscriber, the transition therefore remains incomplete and retries the callback on every subsequent observation without emitting any diagnostic, leaving partially refreshed components difficult to detect or troubleshoot. Log the first failure before propagating it to the isolating dispatcher.

Useful? React with 👍 / 👎.

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

Labels

aws-microvm Work related to AWS MicroVM onboarding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants