Metrics
The OSO Kafka Backup Operator exposes controller and completed-operation
metrics on port 8080.
| Endpoint | Description |
|---|---|
/metrics | Prometheus metrics |
/healthz or /health | Liveness response |
/readyz or /ready | Readiness response |
The operator runs kafka-backup-core in its own process. Its /metrics
endpoint exposes the kafka_backup_operator_* families listed below; it does
not expose the CLI's live kafka_backup_lag_records, throughput, or snapshot
progress registry. Use the Strimzi operator when
you need separately scrapeable backup/restore Job pods.
Enable scraping
Metrics are enabled by default. With the Prometheus Operator installed, enable the chart's ServiceMonitor:
metrics:
enabled: true
serviceMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
labels:
release: prometheus
helm upgrade --install kafka-backup-operator oso/kafka-backup-operator \
--namespace kafka-backup \
--create-namespace \
--version 1.1.1 \
--values values.yaml
The chart also adds Prometheus scrape annotations to the operator pod by default. To inspect the endpoint directly:
kubectl port-forward -n kafka-backup \
svc/kafka-backup-operator-metrics 8080:8080
curl --fail http://127.0.0.1:8080/metrics
Metrics reference
| Metric | Type | Labels | Description |
|---|---|---|---|
kafka_backup_operator_reconciliations_total | Counter | kind | Reconciliation attempts |
kafka_backup_operator_reconciliation_errors_total | Counter | kind | Reconciliation errors |
kafka_backup_operator_reconcile_duration_seconds | Histogram | kind | Reconciliation duration |
kafka_backup_operator_backups_total | Counter | outcome, namespace, name | Completed backups by outcome |
kafka_backup_operator_backup_size_bytes | Gauge | namespace, name | Last backup size |
kafka_backup_operator_backup_records_total | Gauge | namespace, name | Records processed in the last backup |
kafka_backup_operator_restores_total | Counter | outcome, namespace, name | Completed restores by outcome |
kafka_backup_operator_offset_resets_total | Counter | outcome, namespace | Offset resets by outcome |
kafka_backup_operator_offset_reset_duration_seconds | Histogram | namespace | Offset reset duration |
kafka_backup_operator_validations_total | Counter | outcome, namespace, name | Validations by outcome |
kafka_backup_operator_cleanups_total | Counter | kind | Finalizer cleanup operations |
kafka_backup_operator_health | Gauge | none | Operator health (1 is healthy) |
kafka_backup_operator_backup_records_total is a gauge despite its historical
name: it represents the most recently completed backup, not a monotonically
increasing counter.
Example queries
Reconciliation error rate:
sum by (kind) (
rate(kafka_backup_operator_reconciliation_errors_total[5m])
)
Failed backups during the last hour:
sum by (namespace, name) (
increase(kafka_backup_operator_backups_total{outcome="failure"}[1h])
)
99th-percentile reconciliation duration:
histogram_quantile(
0.99,
sum by (le, kind) (
rate(kafka_backup_operator_reconcile_duration_seconds_bucket[5m])
)
)
Operator unavailable:
absent(kafka_backup_operator_health) or kafka_backup_operator_health != 1
Example alerts
groups:
- name: kafka-backup-operator
rules:
- alert: KafkaBackupOperatorDown
expr: absent(kafka_backup_operator_health) or kafka_backup_operator_health != 1
for: 5m
labels:
severity: critical
annotations:
summary: Kafka Backup Operator is unavailable
- alert: KafkaBackupOperatorReconcileErrors
expr: increase(kafka_backup_operator_reconciliation_errors_total[10m]) > 0
for: 5m
labels:
severity: warning
annotations:
summary: Kafka Backup Operator reconciliation is failing
- alert: KafkaBackupFailed
expr: increase(kafka_backup_operator_backups_total{outcome="failure"}[1h]) > 0
labels:
severity: critical
annotations:
summary: Kafka backup failed
Resource-level spec.metrics
KafkaBackup.spec.metrics is retained in the CRD and passed into the embedded
core configuration. It does not create a second HTTP listener or add live core
progress families to the operator endpoint. Monitor completion through CR
status and the operator metric families above.