Lakestream
Ursa

Observability

Turning metrics on, what Ursa exports, and which signals are worth alerting on.

Ursa instruments its storage and compaction paths with OpenTelemetry. Metric names below are the instrument names Ursa registers, under the instrumentation scope io.lakestream.ursa.storage.

Turning metrics on

Instrumentation is inert unless an OpenTelemetry SDK is present. When Ursa is constructed without an explicit OpenTelemetry instance it falls back to the global one, so metrics appear once an SDK is configured — most commonly by attaching the OpenTelemetry Java agent, or by configuring the SDK in the embedding application.

The standalone compactor's launcher sets -Dotel.exporter.prometheus.host=0.0.0.0, so a Prometheus exporter it is configured with binds on all interfaces. Configure the exporter and its port through the usual otel.* system properties or OTEL_* environment variables.

Attributes are attached per stream: ursa.stream.namespace, ursa.stream.name and ursa.stream.partition.

WAL storage

MetricTypeMeaning
ursa_storage_wal_putEntry_count_totalCounterEntries written to the WAL.
ursa_storage_wal_putEntry_rejected_count_totalCounterEntries rejected on write. A rising count means appends are exceeding the pending-bytes budget.
ursa_storage_wal_putEntry_duration_seconds_bucketHistogramTime to write an entry.
ursa_storage_wal_putEntry_pending_duration_seconds_bucketHistogramTime an entry waits in the write buffer before processing.
ursa_storage_wal_putEntry_cache_duration_seconds_bucketHistogramTime to write an entry into the write cache.
ursa_storage_wal_getEntries_duration_seconds_bucketHistogramTime to read a batch, whichever tier serves it.
ursa_storage_wal_getEntry_duration_seconds_bucketHistogramTime to read a single entry.
ursa_storage_wal_writeCache_flush_duration_seconds_bucketHistogramTime to flush the write cache to storage.
ursa_storage_wal_readCache_loading_count_totalCounterLoads into the read cache from the object store.
ursa_storage_wal_readCache_eviction_count_totalCounterRead-cache evictions.
ursa_storage_wal_readCache_loading_duration_seconds_bucketHistogramTime to load a WAL object into the read cache.
ursa_storage_wal_read_cache_missed_totalCounterReads served by neither cache.
ursa_storage_wal_putEntry_pending_countGaugeEntries currently queued in the write buffer.
ursa_storage_wal_writeCache_flushCallback_pending_countGaugeFlushes awaiting acknowledgement.
ursa_storage_wal_readCache_size_bytesGaugeCurrent read-cache size.

Object storage

MetricTypeMeaning
ursa_storage_backend_storage_request_totalCounterRequests to the backend, local or cloud.
ursa_storage_backend_write_duration_seconds_bucketHistogramBackend write latency.
ursa_storage_backend_read_duration_seconds_bucketHistogramBackend read latency.
ursa_storage_backend_metadata_read_duration_seconds_bucketHistogramBackend metadata read latency.
ursa_storage_backend_crc_duration_seconds_bucketHistogramChecksum computation latency.
ursa_storage_backend_delete_duration_seconds_bucketHistogramObject deletion latency.
ursa_storage_backend_write_bytes_count_bytes_totalCounterBytes written to the backend.
ursa_storage_backend_read_bytes_count_bytes_totalCounterBytes read from the backend.

Write cache

MetricTypeMeaning
ursa_storage_wal_writeCache_used_bytesGaugeBytes in use.
ursa_storage_wal_writeCache_bufferSegment_usedGaugeBuffer segments in use.
ursa_storage_wal_writeCache_cacheSegment_usedGaugeCache segments in use.
ursa_storage_wal_writeCache_segment_countGaugeSegments allocated.
ursa_storage_wal_writeCache_capacity_bytesGaugeConfigured capacity per segment.

Compacted-object reads

MetricTypeMeaning
ursa_storage_lakehouse_read_messages_totalCounterMessages read from compacted Parquet files.
ursa_storage_lakehouse_read_bytes_bytes_totalCounterBytes read.
ursa_storage_lakehouse_read_request_totalCounterRead requests served.
ursa_storage_lakehouse_read_cache_hit_totalCounterPrefetch cache hits.
ursa_storage_lakehouse_read_cache_miss_totalCounterPrefetch cache misses.
ursa_storage_lakehouse_read_latency_seconds_bucketHistogramRead latency.
ursa_storage_lakehouse_read_request_queued_latency_seconds_bucketHistogramTime a read waits in the queue before processing.

Compaction service

The signals here describe progress through three stages: publishing a task, converting the WAL range to Parquet, and committing the result.

MetricTypeMeaning
ursa_storage_compact_ongoing_topic_countGaugeStreams currently being compacted.
ursa_storage_compact_ongoing_task_countGaugeTasks in progress.
ursa_storage_compact_latest_message_offsetGaugeLatest offset per stream.
ursa_storage_compact_latest_published_offsetGaugeLatest offset covered by a published task.
ursa_storage_compact_last_compacted_offsetGaugeLatest offset fully committed.
ursa_storage_compact_lagGaugeDifference between the latest and last-compacted offsets.
ursa_storage_compact_bytes_totalCounterBytes processed.
ursa_storage_compact_messages_totalCounterMessages processed.
ursa_storage_compact_message_end_to_end_duration_seconds_bucketHistogramAppend to table commit, end to end.
ursa_storage_compact_message_from_ursa_to_parquet_duration_seconds_bucketHistogramAppend to Parquet write.
ursa_storage_compact_duration_seconds_bucketHistogramDuration of one task.
ursa_storage_compact_read_messages_duration_seconds_bucketHistogramReading the WAL range.
ursa_storage_compact_write_messages_duration_seconds_bucketHistogramDecoding, converting and writing Parquet.
ursa_storage_compact_task_commit_duration_seconds_bucketHistogramCommitting a task, including the index write.
ursa_storage_compact_commit_to_lakehouse_duration_seconds_bucketHistogramCommitting the table snapshot alone.
ursa_storage_compact_commit_task_batch_sizeGaugeFiles in one commit batch.
ursa_storage_compact_published_task_bytesGaugeBytes covered by one task.
ursa_storage_compact_committed_parquet_file_bytesGaugeSize of committed Parquet files.
ursa_storage_compact_tasks_in_init_stateGaugeTasks awaiting work.
ursa_storage_compact_tasks_in_compacted_stateGaugeTasks converted, not yet committed.
ursa_storage_compact_tasks_in_prepared_commit_stateGaugeTasks prepared for commit.
ursa_storage_compact_tasks_in_committed_stateGaugeTasks committed.
ursa_storage_compact_non_committable_task_histogram_bytes_bucketHistogramSize distribution of non-committable tasks.

ursa_storage_compact_lag is the signal that answers "how far behind are my tables", and ursa_storage_compact_message_end_to_end_duration_seconds_bucket answers "how long until a record appears in one".

What to alert on

These are the signals the source marks as alert-worthy.

MetricCondition
compaction_cluster_leaders_totalSum across the cluster is not exactly 1. Zero means nothing is publishing or committing; more than one means split leadership.
ursa_storage_compact_publish_task_failed_count_totalRising. Tasks are not being published.
ursa_storage_compact_failed_task_count_totalRising. Conversion is failing.
ursa_storage_compact_task_commit_duration_seconds_count with response_status="failed"Rising. Commits to the table are failing.
ursa_storage_compact_quarantined_topics_countAbove zero. Streams are being held back after failures.
ursa_storage_compact_topics_in_dlqAbove zero. Streams have been dead-lettered.
ursa_storage_compact_tasks_in_dlqAbove zero. Tasks have been dead-lettered.
ursa_storage_compact_non_committable_task_countAbove zero. A stream has exceeded the non-committable task threshold.

Table writes and reads

MetricTypeMeaning
ursa_storage_lakehouse_writer_before_write_durationHistogramPreparation before a write.
ursa_storage_lakehouse_writer_write_all_durationHistogramWriting a full batch.
ursa_storage_lakehouse_writer_write_record_durationHistogramWriting one record.
ursa_storage_lakehouse_writer_encode_durationHistogramEncoding before writing.
ursa_storage_lakehouse_reader_seek_durationHistogramSeeking.
ursa_storage_lakehouse_reader_read_all_durationHistogramReading a full batch.
ursa_storage_lakehouse_reader_read_record_durationHistogramReading one record.
ursa_storage_lakehouse_reader_decode_durationHistogramDecoding after reading.

Parquet files

MetricTypeMeaning
ursa_storage_lakehouse_parquet_write_record_durationHistogramWriting records.
ursa_storage_lakehouse_parquet_write_metadata_durationHistogramWriting file metadata.
ursa_storage_lakehouse_parquet_read_record_durationHistogramReading records.
ursa_storage_lakehouse_parquet_read_metadata_durationHistogramReading file metadata.
ursa_storage_lakehouse_parquet_seek_by_offset_durationHistogramSeeking by offset.
ursa_storage_lakehouse_parquet_seek_by_secondary_index_durationHistogramSeeking by secondary index.

A starting dashboard

The Ursa repository ships a Grafana dashboard for the compaction service at dashboard/CompactionService.json.