Skip to Content

Prometheus

Erato provides a Prometheus endpoint based on metrics.rs.

What it exposes

  • Tokio runtime metrics via tokio-metrics + metrics-rs integration
  • erato_info gauge with labels:
    • version
    • environment
    • service
    • deployment_version

Configuration

Enable the integration in erato.toml:

erato.toml
[integrations.prometheus] enabled = true host = "127.0.0.1" port = 3131

When enabled, Erato starts a dedicated listener and prints the metrics URL at startup:

http://<host>:<port>/metrics

integrations.prometheus.port must be different from http_port.

For all configuration fields, see Configuration Reference.

Exposed metrics

Erato currently exposes these application-specific metrics:

Info metrics

For background on _info metrics, see Prometheus Info Metrics.

  • erato_info (gauge)
    • Always 1
    • Labels: version, environment, service, deployment_version
  • erato_chat_provider_info (gauge)
    • Always 1 per configured chat provider
    • Labels: chat_provider_id, provider_kind, model_name

Chat provider metrics

  • erato_chat_provider_time_to_first_token_seconds (histogram)
    • Time from dispatching a chat generation request until the first streamed token, reported in seconds with millisecond precision
    • Labels: chat_provider_id
  • erato_chat_provider_time_to_last_token_seconds (histogram)
    • Time from dispatching a chat generation request until the last streamed token, reported in seconds with millisecond precision
    • Labels: chat_provider_id
  • erato_chat_provider_generation_errors_total (counter)
    • Total number of chat generation failures
    • Labels: chat_provider_id, error_type

MCP metrics

  • erato_mcp_active_sessions (gauge)
    • Current number of active MCP sessions for each configured MCP server
    • Labels: server_id

Cache metrics

  • erato_cache_max_size_bytes (gauge)
    • Maximum configured cache capacity in bytes
    • Labels: cache
  • erato_cache_used_size_bytes (gauge)
    • Current weighted cache usage in bytes
    • Labels: cache
  • erato_cache_fill_ratio (gauge)
    • Current cache utilization ratio in the range 0..1
    • Labels: cache
  • erato_cache_entries (gauge)
    • Current number of entries in the cache
    • Labels: cache
  • erato_cache_time_to_live_seconds (gauge)
    • Configured cache TTL in seconds, or 0 when disabled
    • Labels: cache
  • erato_cache_time_to_idle_seconds (gauge)
    • Configured cache TTI in seconds, or 0 when disabled
    • Labels: cache

Database metrics

  • erato_postgres_query_duration_seconds (histogram)
    • Execution time of Postgres queries, reported in seconds with millisecond precision
    • Labels: query_id, status
    • Known raw SQL statements use centrally defined query IDs
    • All other queries fall back to generated IDs in the form hash-<hash-based-on-query-with-placeholders>

Erato also exposes Tokio runtime metrics via tokio-metrics, but those are produced by the upstream integration rather than defined directly by Erato, so they are not enumerated here.

Last updated on