Skip to content

[WIP] Nexus metrics backport (3/3): completion-path emission + impl=chasm + functional test#10788

Draft
tekkaya wants to merge 2 commits into
gokhan/nexus-op-caller-metrics-hsmfrom
gokhan/nexus-op-caller-metrics-completion
Draft

[WIP] Nexus metrics backport (3/3): completion-path emission + impl=chasm + functional test#10788
tekkaya wants to merge 2 commits into
gokhan/nexus-op-caller-metrics-hsmfrom
gokhan/nexus-op-caller-metrics-completion

Conversation

@tekkaya

@tekkaya tekkaya commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

WIP / draft — for review, not ready to merge.

Stacked on #10787 (base branch gokhan/nexus-op-caller-metrics-hsm). Review #10786#10787 → this PR in order.

This PR (3/3)

Completes the backport.

  • Async completion path (CompleteNexusOperation callbacks): CompletionHandler now records the terminal outcome (succeeded/failed/canceled) and, when it fabricates a started transition for a completion that arrives before the start response, the schedule-to-start latency.
  • The shared emit helpers are refactored into package functions used by both the executor and completion paths.
  • The history Handler is given the nexusoperations Config via fx so it can resolve the metric tag config and pass it (with its metrics handler) into CompletionHandler.
  • Adds impl="chasm" to the CHASM caller metrics so the two engines are distinguishable during the migration (HSM side emits impl="hsm").
  • Functional test TestNexusOperationCallerMetrics: runs an in-workflow Nexus operation to completion and asserts the caller metric is emitted with namespace, nexus_endpoint, the real workflowType, and the engine impl tag. Parameterized over both HSM and CHASM engines (asserts impl=hsm vs impl=chasm) — verifies both implementations at parity.

Chronicle/extobs ingestion is tracked in DEVPROD-1804. The internal impl tag is intended to be stripped at the external-observability boundary so the customer-facing rollup aggregates across engines.

Stack

  1. [WIP] Nexus metrics backport (1/3): HSM NodeBackend workflow-type + namespace accessors #10786 — HSM NodeBackend accessors
  2. [WIP] Nexus metrics backport (2/3): emit caller metrics from HSM executor paths #10787 — executor-side emission
  3. (this PR) completion-path emission + impl=chasm + functional test

🤖 Generated with Claude Code

tekkaya and others added 2 commits June 20, 2026 16:18
Complete the HSM caller-side metrics backport by emitting from the async
completion path (CompleteNexusOperation callbacks): CompletionHandler now
records the terminal outcome (succeeded/failed/canceled) and, when it
fabricates a started transition for a completion that arrives before the
start response, the schedule-to-start latency.

The shared emit helpers are refactored into package functions so both the
executor and completion paths use them. The history Handler is given the
nexusoperations Config (via fx) so it can resolve the metric tag config
and pass it, along with its metrics handler, into CompletionHandler.

Also adds the internal impl="chasm" tag to the CHASM caller metrics so
the two engines are distinguishable during the HSM->CHASM migration
(the HSM side emits impl="hsm"); this tag is intended to be stripped at
the external-observability boundary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds TestNexusOperationCallerMetrics, which runs an in-workflow Nexus
operation to completion and asserts the caller-side operation metric
(nexus_operation_success) is emitted with the caller namespace, endpoint,
real workflow type, and engine ("impl") tag, plus a latency metric.

The test is parameterized over the HSM and CHASM engines (via the existing
parallelsuite HSM/CHASM runners) and asserts the engine-specific impl tag
(hsm vs chasm), exercising both implementations at parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tekkaya tekkaya force-pushed the gokhan/nexus-op-caller-metrics-completion branch from d39c00a to ccb62d4 Compare June 20, 2026 23:19
@tekkaya tekkaya force-pushed the gokhan/nexus-op-caller-metrics-hsm branch from 59ee603 to 0db1af8 Compare June 20, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant