Skip to content

Tag HSM outbound Nexus call failure logs - #11662

Open
stephanos wants to merge 8 commits into
mainfrom
stephanos/nexus-obs-hsm-log-tags
Open

Tag HSM outbound Nexus call failure logs#11662
stephanos wants to merge 8 commits into
mainfrom
stephanos/nexus-obs-hsm-log-tags

Conversation

@stephanos

@stephanos stephanos commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What changed

The HSM Nexus executor logged outbound call failure logs were missing tags.

Why

chasm/lib/nexusoperation already logs exactly these fields via invocationTraceContext.tags(),

Links: []nexus.Link{args.nexusLink},
}

traceCtx := invocationTraceContext{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This entire change mimics CHASM's

type invocationTraceContext struct {

@stephanos
stephanos marked this pull request as ready for review August 20, 2026 14:39
@stephanos
stephanos requested a review from a team August 20, 2026 14:39
@stephanos
stephanos requested review from a team as code owners August 20, 2026 14:39
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Claude finished @stephanos's task in 2m 46s —— View job


Reviewed 1 file, 1 finding.
branch

if failureSource == commonnexus.FailureSourceWorker || isTimeoutBelowMin {
e.Logger.Debug(msg, tags...)
} else {
e.Logger.Error(msg, tags...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the main fix

return []tag.Tag{
tag.Operation(c.operationTag),
tag.WorkflowNamespace(c.namespaceName),
tag.NexusEndpointTargetNamespaceID(c.targetNamespaceID),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a net new tag.

Comment thread components/nexusoperations/executors.go
stephanos and others added 8 commits August 20, 2026 11:45
The HSM Nexus executor logged outbound call failures with tag.Error
alone, while the CHASM implementation logs ten structured tags for the
same failure. During the HSM->CHASM migration a namespace runs both
implementations at once, so a log query written against the CHASM tags
silently returns only that half of the traffic while looking complete.

Extract the tag list the HTTP trace logger already builds and reuse it
for the failure logs, mirroring chasm/lib/nexusoperation's
invocationTraceContext.tags(). Both the start and cancel paths now share
one construction, and the debug/error level split moves into a helper.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CHASM's invocationTraceContext.tags() emits ten tags; the HSM version
was missing nexus-endpoint-target-namespace-id, which defeats the point
of mirroring it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Holding a reusable []tag.Tag and appending the error onto it tripped
gocritic's appendAssign, which was silenced with a nolint. The warning
is about a real aliasing class: append into a slice with spare capacity
writes through the shared array. Binding the logger once with log.With
removes the slice, so there is nothing to alias and no nolint needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replace the ad-hoc tag helper with the same struct, tags() method and
logCallFailure that chasm/lib/nexusoperation uses, so the two
implementations stay in step. Deriving tags lazily also removes the
aliasing hazard that needed a gocritic nolint, and avoids building them
at all when nothing is logged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
logCallFailure fires from the same block in both executors where the
outcome tags are computed, so reading order now follows call order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@stephanos
stephanos force-pushed the stephanos/nexus-obs-hsm-log-tags branch from af5ea9b to 49f8854 Compare August 20, 2026 18:45
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