Expand description
OpenTelemetry metrics for agent-effects.
use agent_effects::Runtime;
use agent_effects_memory::MemoryStore;
use agent_effects_otel::OtelObserver;
// Uses the global meter provider; set it up with your exporter (OTLP,
// Prometheus, …) as usual.
let runtime = Runtime::builder(MemoryStore::new())
.observer(OtelObserver::global())
.build();Instruments, each with attributes effect.name and effect.kind unless
the table says otherwise:
| Instrument | Kind | Counts / measures |
|---|---|---|
agent_effects.started | counter | effects recorded |
agent_effects.completed | counter | effects committed |
agent_effects.failed | counter | effects that definitely did not apply |
agent_effects.rejected | counter | effects refused by a precondition or approver |
agent_effects.unknown | counter | outcomes that became unknown: watch this one. A spike means remote systems are answering ambiguously |
agent_effects.needs_intervention | counter | effects escalated to an operator |
agent_effects.awaiting_intervention | up/down counter | effects waiting for an operator: escalated or failed compensations (deltas since start) |
agent_effects.attempts | counter, attempt = first | retry | attempts started |
agent_effects.retry.count | counter | retries scheduled |
agent_effects.retry.delay | histogram, s | time from scheduling a retry until it may start |
agent_effects.verification.started | counter | verifications started |
agent_effects.verification.outcomes | counter, outcome = confirmed | not_applied | conflict | inconclusive | how verifications ended |
agent_effects.compensation.started / .completed / .failed | counter | compensations |
agent_effects.pending_approval | up/down counter | effects awaiting approval (deltas since start) |
agent_effects.approval.decisions | counter, decision = approved | denied | approval decisions |
agent_effects.approval.duration | histogram, s, decision | approval requested → decided |
agent_effects.operator.resolutions | counter, resolution = applied | not_applied | retry | compensated | operator decisions on unresolved effects |
agent_effects.lease.expired | counter | attempts whose worker lost its lease mid-flight |
agent_effects.lease.conflicts | counter, effect.name only | a worker found another holding an effect |
agent_effects.lease.renewal_failures | counter, no attributes | lease renewals that failed with a store error |
agent_effects.duration | histogram, s | recorded → committed, failed or rejected |
agent_effects.attempt.duration | histogram, s | one attempt, also tagged outcome (the status it ended in) |
agent_effects.unknown.duration | histogram, s | time spent unknown before being resolved |
agent_effects.recovery.passes | counter, result = completed | stopped | failed | recovery passes |
agent_effects.recovery.duration | histogram, s, result | one recovery pass |
agent_effects.recovery.effects | counter, outcome = resumed | marked_unknown | skipped | unhandled | resume_error | what passes did, per effect |
agent_effects.recovery.backlog | gauge, state = due | not_due | awaiting_operator | what this worker’s latest pass found waiting |
agent_effects.pruned | counter, status | settled records deleted by retention |
Recovery and pruning instruments carry no effect attributes.
No attribute carries an effect id, a logical key, an input, an output, an
actor or an error message: they are unbounded and may identify customers.
Every attribute value comes from a small fixed set, apart from
effect.name, which the application chooses. Traces need no extra crate: the runtime’s tracing spans
(agent_effect.execute, agent_effect.compensate) export through
tracing-opentelemetry like any other.
Structs§
- Otel
Observer - An
EffectObserverthat records OpenTelemetry metrics.