Skip to main content

Metrics Reference

OSO Kafka Backup v0.15.11 exposes Prometheus text-format metrics while a backup or restore is running.

Endpoint configuration

metrics:
enabled: true
port: 8080
bind_address: "0.0.0.0"
path: "/metrics"
update_interval_ms: 500
keep_alive_seconds: 60
max_partition_labels: 100
FieldDefaultDescription
enabledtrueStart the HTTP metrics server
port8080Listener port
bind_address0.0.0.0Listener address
path/metricsMetrics path
update_interval_ms500Metrics recalculation interval
keep_alive_seconds0Continue serving after a one-shot operation completes
max_partition_labels100Maximum unique per-partition label sets; 0 is unlimited

Use keep_alive_seconds for short-lived Jobs so the final values live through at least one scrape. A practical minimum is twice your Prometheus scrape interval. Shutdown signals still stop the process promptly during this window.

Cardinality behavior

The partition limit applies to unique topic/partition/backup_id label sets used by kafka_backup_lag_records, kafka_backup_lag_bytes, and kafka_backup_lag_seconds.

  • Repeated updates to an admitted partition do not consume more slots.
  • Admitted partitions continue updating after the limit is reached.
  • 0 disables the limit; use it only when the number of partitions is bounded.
  • Aggregate lag and finite snapshot progress include all partitions, including those omitted by the per-partition limit.

Backup and progress metrics

MetricTypeLabelsDescription
kafka_backup_lag_recordsGaugetopic, partition, backup_idCurrent records behind for a partition
kafka_backup_lag_bytesGaugetopic, partition, backup_idEstimated bytes behind for a partition
kafka_backup_lag_secondsGaugetopic, partition, backup_idTime lag for a partition
kafka_backup_lag_records_maxGaugebackup_idMaximum current partition lag
kafka_backup_lag_records_sumGaugebackup_idCurrent lag summed across every partition
kafka_backup_snapshot_records_targetGaugebackup_idRecords in the captured finite-backup range
kafka_backup_snapshot_records_remainingGaugebackup_idRecords left before the finite backup completes
kafka_backup_throughput_records_per_secGaugebackup_id, topicCurrent record throughput
kafka_backup_throughput_bytes_per_secGaugebackup_id, topicCurrent byte throughput
kafka_backup_records_total_totalCounterbackup_idRecords backed up
kafka_backup_bytes_total_totalCounterbackup_idUncompressed bytes backed up
kafka_backup_duration_secondsHistogrambackup_id, statusBackup duration
kafka_backup_last_successful_commitGaugebackup_id, topic, partitionUnix timestamp of the last offset commit
kafka_backup_consumer_rebalance_total_totalCounterbackup_idConsumer group rebalances

The doubled _total_total suffix is the emitted name for counters whose registered family name already ends in _total.

Storage, compression, and error metrics

MetricTypeLabelsDescription
kafka_backup_storage_write_latency_secondsHistogrambackend, operationStorage write latency
kafka_backup_storage_read_latency_secondsHistogrambackend, operationStorage read latency
kafka_backup_storage_write_bytes_total_totalCounterbackend, backup_idBytes written to storage
kafka_backup_storage_read_bytes_total_totalCounterbackend, backup_idBytes read from storage
kafka_backup_storage_errors_total_totalCounterbackend, error_typeStorage errors
kafka_backup_compression_ratioGaugealgorithm, backup_idUncompressed-to-compressed ratio
kafka_backup_compressed_bytes_total_totalCounteralgorithm, backup_idCompressed bytes written
kafka_backup_uncompressed_bytes_total_totalCounteralgorithm, backup_idBytes before compression
kafka_backup_errors_total_totalCounterbackup_id, error_typeOperation errors
kafka_backup_retries_total_totalCounterbackup_id, operationRetry attempts

Storage operations are labelled segment, manifest, checkpoint, or other. Error categories include broker_connection, consumer_timeout, deserialization, storage_io, codec, offset_invalid, auth, timeout, not_found, quota, and unknown.

Restore metrics

MetricTypeLabelsDescription
kafka_restore_duration_secondsHistogrambackup_id, statusRestore duration
kafka_restore_progress_percentGaugerestore_id, backup_idCompletion percentage
kafka_restore_eta_secondsGaugerestore_idEstimated seconds remaining
kafka_restore_throughput_records_per_secGaugerestore_idCurrent record throughput
kafka_restore_records_total_totalCounterrestore_idRecords restored

Useful PromQL

Finite snapshot completion percentage:

100 * (
1 - kafka_backup_snapshot_records_remaining
/ clamp_min(kafka_backup_snapshot_records_target, 1)
)

Current total lag without a high-cardinality sum:

kafka_backup_lag_records_sum

Record throughput over five minutes:

rate(kafka_backup_records_total_total[5m])

99th-percentile storage write latency:

histogram_quantile(
0.99,
sum by (le, backend, operation) (
rate(kafka_backup_storage_write_latency_seconds_bucket[5m])
)
)

Errors during the last five minutes:

sum by (backup_id, error_type) (
increase(kafka_backup_errors_total_total[5m])
)

Scrape configuration

scrape_configs:
- job_name: kafka-backup
static_configs:
- targets: ["kafka-backup-host:8080"]
metrics_path: /metrics
scrape_interval: 30s

For Kubernetes Jobs managed by the Strimzi Backup Operator, use its Job PodMonitor configuration. A ServiceMonitor cannot discover a short-lived Job pod unless a matching Service is also created.