Skip to content

Metrics ​

ordo-server serves Prometheus metrics at GET /metrics on the HTTP port. It is always on, and never needs the API token.

yaml
# prometheus.yml
scrape_configs:
  - job_name: ordo
    static_configs:
      - targets: ['ordo:8080']

Executions ​

MetricTypeLabels
ordo_executions_totalcounterruleset, result (success, error)
ordo_execution_duration_secondshistogramruleset
ordo_terminal_results_totalcounterruleset, result_code
ordo_active_executionsgauge
ordo_batch_executions_totalcounterruleset
ordo_batch_sizehistogramruleset
ordo_batch_duration_secondshistogramruleset
ordo_batch_results_totalcounterruleset, result
ordo_evals_totalcounterresult
ordo_eval_duration_secondshistogram

With multi-tenancy, ordo_tenant_executions_total (tenant_id, ruleset, result), ordo_tenant_execution_duration_seconds, ordo_tenant_rules_total and ordo_tenant_rate_limited_total are added.

Server and storage ​

MetricTypeLabels
ordo_infogaugeversion
ordo_uptime_secondsgauge
ordo_rules_totalgauge
ordo_store_operations_totalcounteroperation
ordo_hot_reloads_totalcounterkind, result
ordo_last_reload_timestamp_secondsgauge
ordo_wal_size_bytes, ordo_wal_segments_total, ordo_wal_pending_entriesgauge
ordo_wal_writes_totalcounterop, state
ordo_wal_replays_totalcounterop, result
ordo_wal_rotations_totalgauge
ordo_sync_events_published_total, ordo_sync_events_applied_totalcounterevent_type
ordo_sync_events_failed_totalcounterevent_type, stage
ordo_last_sync_timestamp_secondsgauge

Metrics from rules ​

A metric action in a rule is exported as the gauge ordo_rule_<name>, with its tags as labels:

json
{ "action": "metric", "name": "order_amount", "value": "order.amount", "tags": [["tier", "gold"]] }
text
ordo_rule_order_amount{tier="gold"} 42

Useful queries ​

text
# executions per second, by ruleset
sum by (ruleset) (rate(ordo_executions_total[5m]))

# error ratio
sum(rate(ordo_executions_total{result="error"}[5m])) / sum(rate(ordo_executions_total[5m]))

# p99 latency
histogram_quantile(0.99, sum by (le, ruleset) (rate(ordo_execution_duration_seconds_bucket[5m])))

# share of each result code
sum by (result_code) (rate(ordo_terminal_results_total{ruleset="discount"}[1h]))

A reasonable first alert is on the error ratio, and on up{job="ordo"} == 0.

Traces ​

Set --otlp-endpoint (for example http://otel-collector:4318) to export OpenTelemetry traces over OTLP HTTP. Works with the OpenTelemetry Collector, Jaeger, Tempo and other OTLP backends. --service-name sets the service name.

Released under the MIT License.