Observability and metrics

Prometheus metrics

federiq serve exposes metrics at /metrics in Prometheus text format.

MetricKindLabels
federiq_queries_totalcounter
federiq_query_errors_totalcounter
federiq_query_duration_secondshistogram
federiq_http_requests_totalcounterroute
federiq_auth_failures_totalcounter

Scrape config:

scrape_configs:
  - job_name: federiq
    static_configs:
      - targets: ["federiq.internal:7878"]

Structured logs

export FEDERIQ_LOG_FORMAT=json
federiq serve

Emits one JSON object per log event (stdout), with event fields flattened so they're indexable by downstream shipper.

Log levels are controlled by RUST_LOG:

RUST_LOG=federiq=debug,federiq_core=debug federiq serve

Per-source attach timing

Every source's ATTACH latency is tracked by the engine:

federiq query "SELECT 1" --timing
per-source attach timing:
  events               parquet  2.14ms
  sales                postgres 84.2ms

And from Python:

import json
print(json.dumps(engine.attach_timings(), indent=2))

EXPLAIN ANALYZE

DuckDB's EXPLAIN ANALYZE gives operator-level timing that naturally includes federated source scan costs:

federiq query "SELECT COUNT(*) FROM events" --explain-analyze