Observability
Observability gives you real-time metrics, latency percentiles, and cost attribution, with summary and detailed views on all plans including Free. The numbers sit on top of the signed record Asqav keeps for each action, so the underlying evidence stays verifiable, and you can pipe the same data into your existing stack.
Summary Metrics
Get a high-level overview of your fleet. Available on all plans including Free:
import asqav
asqav.init(api_key="sk_...")
# Get summary metrics (free tier)
summary = Asqav.Observability.summary()
print(f"Total agents: {summary.total_agents}")
print(f"Active agents: {summary.active_agents}")
print(f"Total actions: {summary.total_actions}")
print(f"Error rate: {summary.error_rate}%")
print(f"Avg latency: {summary.avg_latency_ms}ms")
Detailed Metrics
Query granular metrics with configurable time windows. Available on all plans:
# Detailed metrics with time window
metrics = Asqav.Observability.metrics(
window_type="1hr"
)
for point in metrics.data_points:
print(f"{point.timestamp}: {point.actions} actions, {point.error_rate}% errors")
Latency Percentiles
Track latency distribution across your agent fleet. Percentile metrics help identify outliers and performance degradation:
- p50 - Median latency. Half of all requests complete faster than this value
- p95 - 95th percentile. Only 5% of requests are slower
- p99 - 99th percentile. Captures tail latency for worst-case scenarios
# Latency percentiles are included in detailed metrics
metrics = Asqav.Observability.metrics(
window_type="5min"
)
print(f"p50: {metrics.latency_p50}ms")
print(f"p95: {metrics.latency_p95}ms")
print(f"p99: {metrics.latency_p99}ms")
Per-Agent Metrics
Drill down into individual agent performance:
# Get metrics for a specific agent
agent_metrics = Asqav.Observability.agent_metrics(
agent_id="agent_abc123",
window_type="1hr"
)
print(f"Agent: {agent_metrics.agent_name}")
print(f"Actions: {agent_metrics.total_actions}")
print(f"Error rate: {agent_metrics.error_rate}%")
print(f"Avg latency: {agent_metrics.avg_latency_ms}ms")
print(f"p99 latency: {agent_metrics.latency_p99}ms")
Cost Attribution
Track costs across your agent fleet with per-agent breakdowns:
# Get cost attribution
costs = Asqav.Observability.costs(
window_type="1day"
)
print(f"Total cost: ${costs.total_cost}")
for agent in costs.by_agent:
print(f" {agent.name}: ${agent.cost} ({agent.percentage}%)")
Window Types
Configure the time granularity for metric queries:
| Window | Granularity | Retention |
|---|---|---|
5min |
5-minute buckets | 7 days |
1hr |
1-hour buckets | 30 days |
1day |
Daily buckets | 365 days |
Summary metrics via Observability.summary() are available on all plans, including Free. Detailed metrics, per-agent breakdowns, and cost attribution are available on all plans too.
Rejected attempts log
Every 4xx rejection on sign, verify, replay, and applied-attestation is persisted to the rejected_attempts table. Probes, suspended-agent rejects, cross-org access attempts, bad signatures, and counterparty-key mismatches all leave a row.
Query the log on all plans via GET /api/v1/observability/rejected-attempts. Filters: failure_reason, agent_id, time window. Pagination is offset-based.
curl "https://api.asqav.com/api/v1/observability/rejected-attempts?failure_reason=agent_suspended&hours=24" \
-H "X-API-Key: sk_live_..."
Public verify rejections (no organization context, e.g. probes against an unknown signature_id) are admin-only and do not surface to tenant queries.
| failure_reason | Endpoint | Trigger |
|---|---|---|
signature_not_found | verify | Unknown signature_id, including probes. |
signature_expired | verify | Past valid_until on a record signed with replay protection. |
signer_key_mismatch | verify | Agent's current key differs from the key that signed. |
agent_suspended | sign, countersign | Agent suspended by policy auto-remediation or operator action. |
agent_revoked | sign, countersign | Agent revoked. |
agent_decommissioned | sign, countersign | Agent decommissioned. |
agent_quarantined | sign, countersign | Critical-alert quarantine on Enterprise. |
cross_org_access | any | API key from a different organization than the resource. |
executor_key_mismatch | applied-attestation | Counterparty pinning mismatch. See Attestation. |