Repository navigation
5.x: fully silence Open Telemetry export and logging for IAgentCommand executions - #4117
Merged
Merged
Conversation
…kport) A client on Wolverine 5.x reported that IAgentCommand executions still publish Open Telemetry data even though the agent-command handler chain already runs with ProcessingLogLevel/SuccessLogLevel = None and TelemetryEnabled = false (GH-1670). Two gaps remained on this branch, both long since closed on main: - CritterWatch GH-907 (main commit 2c0aea2): the meter counters in WolverineRuntime.Tracking were unconditional, and the executor factory excluded IAgentCommand only from the two CritterWatch publishing modes — so in the DEFAULT metrics mode every agent command still hit wolverine-messages-sent/received, wolverine-execution-time, and wolverine-messages-succeeded. Sending agents, local queues, listening pipelines, and executors now resolve their tracker once at construction through MessageTrackingFor(endpoint)/trackerFor: system message types, System-role endpoints, and telemetry-disabled endpoints get the new metrics-silent SystemTrafficMessageTracker, which keeps the debug logging, tracked-session bookkeeping, and wire taps but records nothing. An endpoint promoted to node control duty (UseTcpForControlEndpoint, broker control queues) is stamped with the System role by the NodeControlEndpoint setter. - wolverine#3774: completion continuations (success, no-handler, error-queue, discard) reported through the runtime's global tracker no matter what the executor resolved, so a successful agent command still recorded wolverine-messages-succeeded + wolverine-effective-time. The executor now stamps its resolved tracker on the MessageContext and the continuations honor the metrics-silent selection via CompletionTrackerFor. One step past the main parity line, in the spirit of "no spans for agent commands, period": the NodeControlEndpoint setter also switches TelemetryEnabled off, suppressing the send/receive/execution spans that were still published whenever the control endpoint was a broker queue or TCP endpoint. The database control endpoint and the local agent queue were already born with telemetry disabled; this closes the remaining control-transport hole. Full CoreTests (1689) pass on net9.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JonathanS-NTI
pushed a commit
to JonathanS-NTI/wolverine
that referenced
this pull request
Aug 25, 2026
…asperFxGH-1670 follow-up) The JasperFxGH-907 work stamps EndpointRole.System on any endpoint promoted to node control duty, which silences the meters — but the receive span and the pipeline-level execution span are gated by the ENDPOINT's TelemetryEnabled flag, not the agent-command chain's. So a broker control queue (EnableWolverineControlQueues on Rabbit MQ, Azure Service Bus, or SQS) or a TCP control endpoint still published send, receive, and execution Open Telemetry spans for every IAgentCommand it carried, while the database control endpoint — born with TelemetryEnabled = false — was quiet. The NodeControlEndpoint setter now switches telemetry off along with the role promotion, closing the hole for every promoted control transport at once. Known trade-off: the broker control queues also set IsUsedForReplies, so on hosts that opt into them, replies to cross-node request/reply arriving on the control queue lose their receive span as well. Those queues are framework plumbing by design; their metrics were already silenced by the System role. Mirrors the 5.x change in JasperFx#4117. Full CoreTests (2642) pass on net9.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
A client reported that the latest 5.x still publishes Open Telemetry data for
IAgentCommandexecutions, despite the earlier noise-reduction work (GH-1670: the agent-command chain already runs withProcessingLogLevel/SuccessLogLevel = LogLevel.NoneandTelemetryEnabled = falseon this branch). This PR brings the 5.x line up to whatmainalready does for agent-command observability, and closes the one remaining span hole.1. Backport of CritterWatch GH-907 (
maincommit 2c0aea2)On 5.x, the executor factory excluded
IAgentCommandfrom metrics only in the two CritterWatch publishing modes — so in the default metrics mode every agent command execution still recordedwolverine-messages-sent,wolverine-messages-received,wolverine-execution-time, andwolverine-messages-succeededon the OTel meters. That is the "OTel export for agent commands" a collector still sees.Now, exactly as on
main:WolverineRuntime.SystemTrafficMessageTracker— keeps the Debug-level logging, tracked-session bookkeeping, and wire taps, but records no meter measurements.MessageTrackingFor(endpoint): a System-role endpoint or one withTelemetryEnabled = falsegets the silent tracker.trackerForexcludes the full system-message surface (IsSystemMessageType():IInternalMessage,IAgentCommand,INotToBeRouted, opted-out assemblies) in every metrics mode, and consults the endpoint's role — including the runtime-levelBuildFor(Type)used by local invocation.NodeControlEndpointsetter stampsEndpointRole.Systemon any endpoint promoted to node control duty (UseTcpForControlEndpoint, broker control queues), which the database and shared-memory control endpoints already had from birth.2. Backport of wolverine#3774
Completion continuations (success, no-handler, error-queue, discard) reported through the runtime's global tracker regardless of what the executor resolved, so a successful agent command still recorded
wolverine-messages-succeeded+wolverine-effective-time. The executor now stamps its resolved tracker on theMessageContext, and the continuations honor the metrics-silent selection throughCompletionTrackerFor(narrow diversion: only the silent tracker is diverted; Direct/Hybrid publishing trackers keep the historical runtime-global reporting to avoid double-counting).3. No more spans for agent commands over control transports
Execution spans were already suppressed by the chain gate, and the local agent queue + database control endpoint were already born with
TelemetryEnabled = false— but a control endpoint that is a broker queue (e.g. RabbitMQEnableWolverineControlQueues) or a TCP endpoint kept the defaultTelemetryEnabled = true, so every agent command over it still published send, receive, and pipeline-level execution spans. TheNodeControlEndpointsetter now switchesTelemetryEnabledoff along with the System-role promotion. Node control traffic is nothing but agent commands and their replies, so nothing user-visible is lost.This last piece goes one step past
main(which stamps only the role);mainshould probably pick it up as a follow-up.Out of scope, deliberately
wolverine_node_assignmentshealth-check traces stay governed byDurability.NodeAssignmentHealthCheckTracingEnabled/NodeAssignmentHealthCheckTraceSamplingPeriod(default enabled), matchingmain. A client who wants those gone can set the flag tofalse.LogInformationlines ("Successfully started agent …") matchmainand are untouched.Testing
CoreTests.Runtime.system_traffic_metrics_silencing(12 tests, adapted from themainsuite for xUnit v2 and this branch's surface) pins the tracker selection per endpoint role/telemetry flag/message type, meter silence via aMeterListener, the control-endpoint promotion, and the continuation diversion.wolverine.slnxbuilds clean pinned to net9.0 (Release).🤖 Generated with Claude Code