Expand description
OTLP dispatch-rate counters for commands/queries/reports/views.
Mirrors the entity_set_stats.rs/report_cache_stats.rs idiom but
reports through OTel Counters instead of a periodic log line, so a
dashboard can compute per-second rates and slice by tag (command/query/
report/view id, and dispatch origin) instead of grepping logs.
Cheap/no-op without a registered MeterProvider (see myko-server’s
telemetry::init_from_env) — opentelemetry::global::meter falls back
to a no-op meter when telemetry isn’t configured, so these calls are
safe to leave in unconditionally.
Functions§
- record_
command - One increment per command execution, tagged by
commandid andsource—"external"for commands arriving pre-serialized viaCommandExecutorAdapter::execute_from_value(the funnel for both native-WS command dispatch and MCP HTTP/WS in-process tool calls), vs"internal"for commands composed in-process by another command handler or a saga viaCommandContext::execute_command. This is a dispatch path distinction, not a transport one — it answers “did this arrive from outside the process or get called by server-side code composing commands,” which is what actually matters for load attribution. - record_
query - record_
query_ response - record_
report - record_
report_ response - record_
view - record_
view_ response