honcho/tests/telemetry
Phil fb8543a0c2 telemetry: generalize counter zero-init to all bounded-label counters
Extends #927 (which zero-inited telemetry_events_dropped) to every counter
whose label domain is bounded and known at startup, so metrics are present in
Prometheus before their first event — a missing series then signals a broken
scrape rather than "nothing happened yet".

- add initialize_bounded_metrics(instance_type) on PrometheusMetrics; call it
  per-process from main.py (api) and deriver/__main__.py (deriver).
- extract a shared _touch() helper; refactor initialize_telemetry_dropped_metrics
  onto it (that one stays per-emitter in start() — it's prefix-dependent).
- explicit ALL_EVENT_TYPES / HIGH_VOLUME_EVENT_TYPES registry in telemetry.events,
  drift-guarded by tests that walk BaseEvent subclasses.
- only VALID (task_type, token_type, component) tuples for deriver_tokens (the
  cartesian product would fabricate impossible always-0 series); only high-volume
  event types for sampled_out; high-cardinality labels (endpoint, workspace_name)
  left open.
- gauges: zero-init embed_now_tasks_in_flight + telemetry_buffer_size; add a new
  message_embeddings_pending backlog gauge, set each reconciliation cycle and
  zero-inited at deriver startup (Rajat's pending/in-flight ask).
- backfills the tests #927 shipped without.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 15:01:09 -04:00
..
__init__.py Telemetry Overhaul (#333) 2026-01-21 16:49:14 -05:00
conftest.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
test_cross_agent_trace.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
test_embedding_call_event.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_embedding_trace.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
test_emit_function.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
test_emitter.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_events.py Session-purity invariant + card_refresh dream type (DEV-2000) (#883) 2026-07-23 14:22:07 -04:00
test_langfuse_exporter.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00
test_metric_zero_init.py telemetry: generalize counter zero-init to all bounded-label counters 2026-07-28 15:01:09 -04:00
test_representation_v2_fields.py Counts documents deduped during representation, exact and semantically similar 2026-07-16 14:30:55 -02:00
test_sentry_before_send.py Vineeth/sentry filter consolidation (#934) 2026-07-24 15:42:41 -04:00
test_sentry_sampler.py Filter noisy sentry traces/profiles (#834) 2026-06-22 21:14:55 -04:00
test_summary_v2_fields.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_trace_events.py feat(telemetry): CloudEvents + Langfuse tracing as projections over a captured LLM stream (#845) 2026-07-02 16:49:53 -04:00