Make Nexus link warnings aggregatable (#11685)

## What changed

All three warnings in `ConvertNexusLinksToProtoLinks` interpolated the
link type into the message, and two also embedded the link URL. Moved
both into tags and kept the message static.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stephan Behnke
2026-08-24 08:42:14 -07:00
committed by GitHub
parent 33e99171eb
commit fc7b395f63

View File

@@ -1,8 +1,6 @@
package nexus
import (
"fmt"
"github.com/nexus-rpc/sdk-go/nexus"
commonpb "go.temporal.io/api/common/v1"
"go.temporal.io/api/temporalnexus"
@@ -21,8 +19,10 @@ func ConvertNexusLinksToProtoLinks(nexusLinks []nexus.Link, logger log.Logger) [
link, err := ConvertNexusLinkToLinkWorkflowEvent(nexusLink)
if err != nil {
logger.Warn(
fmt.Sprintf("failed to parse link to %q: %s", nexusLink.Type, nexusLink.URL),
"failed to parse Nexus link",
tag.Error(err),
tag.NewStringTag("nexus-link-type", nexusLink.Type),
tag.URL(nexusLink.URL.String()),
)
continue
}
@@ -33,8 +33,10 @@ func ConvertNexusLinksToProtoLinks(nexusLinks []nexus.Link, logger log.Logger) [
link, err := ConvertNexusLinkToLinkActivity(nexusLink)
if err != nil {
logger.Warn(
fmt.Sprintf("failed to parse link to %q: %s", nexusLink.Type, nexusLink.URL),
"failed to parse Nexus link",
tag.Error(err),
tag.NewStringTag("nexus-link-type", nexusLink.Type),
tag.URL(nexusLink.URL.String()),
)
continue
}
@@ -54,7 +56,9 @@ func ConvertNexusLinksToProtoLinks(nexusLinks []nexus.Link, logger log.Logger) [
Variant: &commonpb.Link_Workflow_{Workflow: link},
})
default:
logger.Warn(fmt.Sprintf("invalid link data type: %q", nexusLink.Type))
logger.Warn("invalid Nexus link data type",
tag.NewStringTag("nexus-link-type", nexusLink.Type),
)
}
}
return out