Expand description
The metrics CodoSEO records, named and labelled in one place. The metrics facade does
nothing until a recorder is installed (the codoseo binary installs a Prometheus one for
its server roles when CODOSEO_METRICS_BIND is set), so library code and tests can call
these freely.
Labels are a closed set of short words (a lane number, an outcome, a channel kind). Never put a URL, a domain, an email or an id in one: every distinct value is a new time series.
Structs§
- Running
Crawl - Holds one running crawl in the gauges:
crawls_runninggoes up by one and the reserved memory byreserved_bytes, both undone when this is dropped (a panic included).
Enums§
- Surface
- Which API an agent call came through.
- Tier
- Whether the caller sent an API key (
key) or is one of the no-key MCP clients (anon).
Constants§
- ALERT_
DELIVERIES_ TOTAL - ALL
- Every metric name, for the tests and the docs.
- API_
REQUESTS_ TOTAL - API_
RESULTS - What
api_requests_total’sresultis:ok, anAgentError::codeorerror. - CHANNELS
- The alert channel kinds (
ChannelKind::as_str). - CRAWLS_
FINISHED_ TOTAL - CRAWLS_
RUNNING - CRAWL_
QUEUE_ WAIT_ SECONDS - DB_
POOL_ CONNECTIONS - JOBS_
FAILED_ TOTAL - JOB_
KINDS - The job kinds (
JobKind::slug). - LANES
- Crawl priorities run 0 (most urgent) to 5; the label is the lane.
- PAGES_
CRAWLED_ TOTAL - SCHEDULER_
LAST_ TICK_ TIMESTAMP_ SECONDS - WORKER_
MEMORY_ BUDGET_ BYTES - WORKER_
MEMORY_ RESERVED_ BYTES
Functions§
- alert_
delivery - One delivery attempt on a channel of kind
channel(ChannelKind::as_str). - api_
request - One agent API call that ended with
result(okor an error code). - crawl_
finished - A crawl run ended:
completedwhen its results were stored, otherwisefailed. - crawl_
started - Marks a crawl as running, reserving
reserved_bytesof the worker’s memory budget. - db_pool
- The pool’s connections right now:
idleones are free,activeones are checked out. - job_
failed - A job of kind
kind(JobKind::slug) failed or panicked. - pages_
crawled - queue_
wait - A claimed crawl waited
secondsin the queue.priorityis the crawl’s priority (its lane). - register
- Describes every metric and creates the series that are known up front at zero, so a scrape
right after startup already lists them (and
rate()sees the first increment). - scheduler_
tick - worker_
memory_ budget