Skip to content

5.x: fully silence Open Telemetry export and logging for IAgentCommand executions - #4117

Merged
jeremydmiller merged 1 commit into
5.0from
gh-907/system-traffic-silencing-5.0
Aug 25, 2026
Merged

jeremydmiller merged 1 commit into
5.0from
gh-907/system-traffic-silencing-5.0

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

What this does

A client reported that the latest 5.x still publishes Open Telemetry data for IAgentCommand executions, despite the earlier noise-reduction work (GH-1670: the agent-command chain already runs with ProcessingLogLevel/SuccessLogLevel = LogLevel.None and TelemetryEnabled = false on this branch). This PR brings the 5.x line up to what main already does for agent-command observability, and closes the one remaining span hole.

1. Backport of CritterWatch GH-907 (main commit 2c0aea2)

On 5.x, the executor factory excluded IAgentCommand from metrics only in the two CritterWatch publishing modes — so in the default metrics mode every agent command execution still recorded wolverine-messages-sent, wolverine-messages-received, wolverine-execution-time, and wolverine-messages-succeeded on the OTel meters. That is the "OTel export for agent commands" a collector still sees.

Now, exactly as on main:

  • New metrics-silent WolverineRuntime.SystemTrafficMessageTracker — keeps the Debug-level logging, tracked-session bookkeeping, and wire taps, but records no meter measurements.
  • Sending agents, local queues, and listening pipelines resolve their tracker once at construction via MessageTrackingFor(endpoint): a System-role endpoint or one with TelemetryEnabled = false gets the silent tracker.
  • The executor factory's trackerFor excludes 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-level BuildFor(Type) used by local invocation.
  • The NodeControlEndpoint setter stamps EndpointRole.System on 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 the MessageContext, and the continuations honor the metrics-silent selection through CompletionTrackerFor (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. RabbitMQ EnableWolverineControlQueues) or a TCP endpoint kept the default TelemetryEnabled = true, so every agent command over it still published send, receive, and pipeline-level execution spans. The NodeControlEndpoint setter now switches TelemetryEnabled off 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); main should probably pick it up as a follow-up.

Out of scope, deliberately

  • The wolverine_node_assignments health-check traces stay governed by Durability.NodeAssignmentHealthCheckTracingEnabled / NodeAssignmentHealthCheckTraceSamplingPeriod (default enabled), matching main. A client who wants those gone can set the flag to false.
  • The agent lifecycle LogInformation lines ("Successfully started agent …") match main and are untouched.

Testing

  • New CoreTests.Runtime.system_traffic_metrics_silencing (12 tests, adapted from the main suite for xUnit v2 and this branch's surface) pins the tracker selection per endpoint role/telemetry flag/message type, meter silence via a MeterListener, the control-endpoint promotion, and the continuation diversion.
  • Full CoreTests: 1689 passed, 0 failed on net9.0.
  • Full wolverine.slnx builds clean pinned to net9.0 (Release).

🤖 Generated with Claude Code

…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>
@jeremydmiller
jeremydmiller merged commit 9c95917 into 5.0 Aug 25, 2026
21 checks passed
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>
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