Skip to main content
SmithDB components expose Prometheus metrics at /metrics on each pod’s HTTP port. This page lists the metrics worth watching for each component and how to read them. Each table describes the metrics of one component in one line. The section for each metric under the table tells you how to use it. For scrape and export configuration, see Configure SmithDB observability. For alerts on these metrics, see Recommended SmithDB alerts. To find the cause of a problem, see Diagnose common SmithDB issues. Names are as they appear on /metrics. If your collector adds a namespace or prefix, adjust accordingly. For the tabbed Datadog and Grafana dashboards and their collection requirements, see Monitor self-hosted LangSmith with Datadog or Grafana. For Grafana installations without native tabs, the standalone SmithDB dashboard uses Classic format.
This page covers metrics that SmithDB and LangSmith emit. Also monitor these signals from your infrastructure monitoring:
  • Kubernetes: OOM kills, container restarts, CPU and memory against limits, and cache disk usage.
  • Redis: memory use against its limit, and evicted keys. If Redis is full, LangSmith cannot queue new runs. Any eviction means that Redis deleted data that LangSmith still needs, and runs can be lost.
  • Metastore: CPU, connections, and storage of the PostgreSQL database. A slow metastore makes ingestion, queries, and compaction slow.

LangSmith ingestion pipeline

The LangSmith ingestion pipeline is not part of SmithDB, but it sends all runs to SmithDB and SmithDB problems are often visible here first. Monitor it together with SmithDB. To collect these metrics, see Export LangSmith telemetry.

langsmith_ingestion_e2e_latency_seconds

Histogram Time from when the API receives a run until SmithDB stores it. This is the delay that users see, including the wait in Redis and all retries. During dual ingestion, compare SmithDB with ClickHouse to see if SmithDB keeps up. Short spikes are normal. Query: Use p95. The highest bucket is 60 s, so the p99 often stays at 60 s and does not show changes. Filter on store="smithdb". To compare with ClickHouse, split by store (smithdb or clickhouse).

langsmith_ingestion_api_to_worker_latency_seconds

Histogram Time that a run waits in Redis before a worker starts it. If it increases while langsmith_ingestion_worker_to_store_latency_seconds is stable, there are not enough ingest queue workers, and the problem is not in SmithDB. Query: Filter on store="smithdb". To compare with ClickHouse, split by store (smithdb or clickhouse).

langsmith_ingestion_worker_to_store_latency_seconds

Histogram Time of one write from an ingest queue worker to SmithDB. If it increases, the problem is in SmithDB or in its dependencies. Slow writes keep the workers busy, so runs also wait longer in Redis. Continue with the SmithDB ingestion metrics. Query: Filter on store="smithdb". To compare with ClickHouse, split by store (smithdb or clickhouse). The value is the time of the full batch, recorded once for each run in the batch.

langsmith_asynq_ingestion_queue_pending

Gauge Tasks that wait in Redis for an ingest queue worker. Tasks that wait for a retry are not included. Monitor the trend relative to traffic, not the number. A queue that increases while traffic is stable is a problem. A sudden decrease is healthy if retries stay stable. Query: Every platform backend pod reports the same value for the whole queue. Use max across pods, not sum.

langsmith_asynq_ingestion_queue_retry

Gauge Tasks whose write failed and that wait for another attempt. These tasks are not in the pending queue. Short increases are normal. If the value stays high, writes from ingest queue workers to SmithDB ingestion fail. After 12 failed attempts (approximately 2.5 hours), the task goes to the archive, and its runs are lost. If config.settings.redisRunsExpirySeconds is shorter than this, run data expires in Redis first, and runs are lost before the task reaches the archive. Query: Every platform backend pod reports the same value for the whole queue. Use max across pods, not sum.

langsmith_asynq_queue_latency_seconds

Gauge Age of the oldest pending task in each Redis queue. LangSmith deletes run data in Redis after a fixed time, set by config.settings.redisRunsExpirySeconds in the Helm chart (6 hours by default). Act long before this value reaches that time. The value covers only pending tasks, and the age starts again after each retry. To find tasks that fail again and again, monitor langsmith_asynq_ingestion_queue_retry. Query: Every platform backend pod reports the same value for each queue. Use max across pods and across the ingestion queues, not sum.

langsmith_asynq_ingestion_queue_archived

Gauge Tasks that failed on all attempts. Their runs are lost. An increase means data loss. Archived tasks stay for 90 days, so monitor increases, not the value. Each queue keeps a maximum of 10,000 archived tasks. When the archive is full, the value stops increasing. Then use langsmith_ingest_task_failures_total to find new failures. Query: Every platform backend pod reports the same value for the whole queue. Use max across pods, not sum.

langsmith_ingest_task_failures_total

Counter Failed attempts of ingest tasks. The task label is the task type. The attempt label is the number of earlier attempts, 0 for the first attempt. Expected retries, such as rate limits, are not counted. For persist_batched_feedbacks, a run that is not ingested yet is also an expected retry. If the last attempt of this task fails for this reason, its feedback is lost, but the failure is not counted. The last attempt depends on the task type. The run tasks and persist_batched_feedbacks have 12 retries, so their last attempt has attempt="12". The smithdb_feedback_mutation and coalesced_smithdb_feedbacks tasks have 25 retries, so their last attempt has attempt="25". After the last attempt, LangSmith does not try the task again, and its data is lost. Query: The ingest queue reports this metric. Use the increase, summed across pods.

SmithDB ingestion

ingest_batch_latency

Histogram Time until new data is durable in SmithDB. Ingestion collects the runs of the same partition (tenant, project, and day) from all requests, and flushes them together as one segment. SmithDB records one value for each partition in a request, from when the runs arrive until their flush completes. The value includes the wait for the flush, so a p50 above 0.5 s is normal. If the p99 stays high, flushes are slow. Examine ingest_flush_duration and the flush semaphores.

ingest_flush_count

Counter Completed and failed flushes to object storage. If the rate of successful flushes (status="success") drops to 0 while runs arrive, writes do not reach object storage. A continuous rate of failed flushes (status="failure") means that object storage or the metastore has errors. Query: Use the rate, summed across pods. Split by status (success or failure). To separate L0 and L1 flushes, also split by level.

ingest_flush_rows

Histogram Runs in each flush. Small L0 flushes are normal, because most tenants and projects send few runs in 500 ms. If rows decrease while the flush rate stays the same, flushes occur too early. Query: Split by level (L0 or L1).

ingest_flush_duration

Histogram Time of each flush, including the time before the flush can start, and flushes that fail. If it increases together with object_store_op_duration, the cause is object storage. If it increases alone, too many flushes run at the same time (see the semaphores), or the metastore is slow.

ingest_flush_reason

Counter Why each flush started. time means that the flush timer fired, size means that the data reached its row limit, and shutdown means that the pod stopped. More size flushes mean more data for each tenant and project. Many shutdown flushes outside of rollouts mean that pods restart. Query: Use the rate, summed across pods. Split by reason and by level (L0 or L1).

ingest_pending_segment_entry_count

Gauge Data on an ingestion pod that is not flushed or merged yet. L0 counts data in memory that is not flushed yet. L1 counts segments on the disk cache that are not merged yet. A large L1 value is normal, because SmithDB merges data only after 10 minutes or 25,000 rows. A value that increases continuously means that flushes are late. SmithDB updates the value only at certain events, so it can stay old for some time. Query: Split by level (L0 or L1). Use max across ingestion pods to find the pod with the most pending data.

semaphore_permits_in_use, semaphore_max_permits

Gauges Flushes that run at the same time on an ingestion pod, compared with the limit. The name label identifies the semaphore: flush_l0 limits the flushes of new data from memory to small L0 segments (default 200), and flush_l1 limits the merges of L0 segments into larger L1 segments (default 10). Short peaks at the maximum are normal. If semaphore_permits_in_use stays at semaphore_max_permits, work waits in the pod. You see this as latency, not as errors. Query: Filter on the name label, for example name="flush_l0".

server_requests_duration on ingestion pods

Histogram Time of each request to an ingestion pod. The path label shows the request type. The most common types end with IngestRunsStream, the writes of runs from ingest queue workers, and ExecuteQueryStream, the reads of the newest segments by query pods. For writes, a status other than 0 is a failed write, which the ingest queue worker tries again. Query: All SmithDB pods report this metric. Select the ingestion pods with the pod or Deployment label that your collector adds, for example langsmith-smithdb-ingestion. Filter on type="grpc", because HTTP requests on these pods are health checks and metrics scrapes. For streams, the value covers the full stream.

SmithDB query

server_requests_duration on query pods

Histogram Time of each request to a query pod. The path label shows the request type. The most common types end with QueryRuns, which lists runs, QueryTraces, which lists traces, and QueryRun, which reads one run. If many request types are slow, examine query_fanout_partitions (compaction is late) and the admission queue (pods are out of memory). Query: Select the query pods with the pod or Deployment label that your collector adds. Each query pool has its own Deployment. Split by path to find the slow request type, and by status to count failures. The status label is the gRPC code, where 0 is success.

query_fanout_partitions

Histogram Scan partitions that a query must open. A scan partition is approximately one segment or a group of segments. The more scan partitions a query opens, the slower it is and the more memory it needs. Compaction merges small segments, so queries open fewer scan partitions. If the p99 increases while traffic is stable, compaction is usually late.

query_fanout_limit_exceeded_total

Counter Queries rejected because they must open too many scan partitions. SmithDB query rejects a query that must open more than 10,000 scan partitions. A continuous rate means that user queries fail. Examine compaction first. Wide time ranges can also cause it. Query: Use the rate, summed across pods.

query_execution_max_mem_used_bytes

Histogram Peak memory of the largest operator in a query, not of the full query. Use it to find request types that need much memory. Use pod memory to see if a pod is near its limit.

query_admission_queue_length

Gauge Requests that wait because a query pod is at its memory limit. New requests wait in the admission queue of the pod, which has 100 places. If the pod has no memory limit, the value always stays at 0. Query: Use max across query pods to find the pod with the longest queue.

query_admission_queue_duration_seconds

Histogram Time that a request waits in the admission queue before it starts. Long waits make queries slow, but they do not fail.

query_admission_queue_rejections_total

Counter Requests rejected because the admission queue is full. Each rejection is a failed query, and means that a query pod is out of memory. Add replicas or memory. Query: Use the rate, summed across pods.

SmithDB compaction

The compaction scheduler keeps its job queue in memory. The queue metrics come from the scheduler pod. The worker metrics come from each worker pod.

compaction_jobs_scheduled, compaction_jobs_executed

Counters Compaction jobs that the scheduler planned and that workers finished. A gap that closes again is normal. If executed stays below scheduled, there are not enough compaction workers. Examine the worker capacity and the pending queue. Query: Use the rate, summed across pods.

compaction_job_completion

Counter Results of compaction jobs, success or failure. Single failures are normal, for example when two jobs change the same segment. A job that is too large for every worker, or that does not finish in time, also counts as a failure. If one job_kind fails again and again, or has no successes, that job kind does not work. Query: Use the rate, summed across pods. Split by status (success or failure) and by job_kind.

compaction_queue_job_count

Gauge Compaction jobs that wait (pending) or run now (inflight). Short peaks are normal, for example after many deletes. A pending count that stays high for hours means that compaction is late. Check if the autoscaler adds compaction workers. By default, it scales on CPU, not on pending jobs. To scale on pending jobs, see Scale with KEDA instead. If the workers are at their maximum replica count, raise the maximum. Query: Split by status (pending or inflight) and by job_kind.

compaction_queue_job_size

Gauge Estimated memory of all compaction jobs that wait or run now. It uses the same unit as worker capacity. If the pending size of one job_kind is larger than the free capacity of every worker, those jobs wait until a worker is almost idle. Add compaction workers, or give them more memory. Query: Split by status (pending or inflight) and by job_kind.

compaction_queue_oldest_pending_created_at_seconds

Gauge Creation time of the oldest compaction job that waits. Some jobs wait for hours, because a compaction worker takes the first job that fits in its free capacity, and large jobs wait until a worker is almost idle. Monitor the trend, not a fixed age. An age that increases continuously means that compaction does not keep up. To find which job kind waits, compare compaction_queue_job_count and compaction_queue_job_size by job_kind. Query: Calculate the age with time() - value, and do not include 0.

compaction_job_latency_seconds

Histogram Time from job creation to completion, including the wait. It increases when compaction workers are full and when jobs are slow. Compare it with worker capacity to find which one. Query: The highest bucket is 900 s, so percentiles do not show longer times. To find jobs that wait longer, use compaction_queue_oldest_pending_created_at_seconds.

compaction_queue_jobs_skipped_capacity

Counter Jobs skipped because they did not fit on a worker. The compaction scheduler counts a job each time a worker asks for work and the job does not fit, so one job can be counted many times. A high rate is normal. Monitor the trend together with the oldest pending age. Query: Use the rate, summed across pods.

compaction_worker_capacity_used, compaction_worker_capacity_limit

Gauges Memory of running jobs, compared with worker capacity. Capacity is an estimate of job memory, by default 80% of the pod memory limit. If most compaction workers stay near their limit, jobs wait and the pending queue increases. Add compaction workers, or give them more memory for larger jobs. Query: Split compaction_worker_capacity_used by job_kind to see which job kinds use the capacity.

compaction_worker_running_tasks

Gauge Compaction jobs that a worker runs now. If the sum is 0 while jobs are pending, the compaction workers have stopped. Make sure that they can connect to the compaction scheduler. Query: Use the sum across compaction workers. Split by job_kind to see which job kinds run.

Shared SmithDB metrics

Several SmithDB components report these metrics.

object_store_op_duration

Histogram Time of each operation on object storage. Query, ingestion, and compaction pods report this metric. They read and write their data in object storage, so slow object storage makes ingestion, queries, and compaction slow. If the value increases on all components at the same time, the cause is object storage or the network to it. Query: Split by op to find the slow operation type, and by result (success, error, or canceled) to find failures. Select one component with the pod or Deployment label that your collector adds.

sys_jemalloc_resident_bytes

Gauge Memory that the SmithDB process uses. Compare it with the pod memory limit. If the value comes near the limit, Kubernetes stops the pod because it is out of memory (OOM kill). Query: Use max across the pods of a component.

SmithDB migration

Migration Job pods report these metrics during a historical migration. Migration does not try failed tasks or jobs again. A failure stops the migration Job before it reaches Complete, and the Job keeps running until you fix the failure. See Migration Job failures.

migration_tasks

Gauge Migration tasks by kind and status. The kind label is run or feedback. The status label is pending, running, completed, or failed. The progress is the completed count, compared with the total of all statuses. Any failed task stops the migration. Query: Every pod reports the same value for the whole migration. The value comes from the migration task database (TaskDB) and changes every two minutes. Use max across pods, not sum.

migration_jobs

Gauge Migration jobs by kind and status. Run jobs finish as promoted, and feedback jobs finish as validated. failed and validation_failed are failures and stop the migration. All other statuses mean that the job is still in progress. Query: Every pod reports the same value for the whole migration. The value comes from TaskDB and changes every two minutes. Use max across pods, not sum.

migration_run_tasks_completed_total

Counter Run tasks that a pod completed. The rate is the migration throughput in tasks. Query: Use the rate, summed across pods.

migration_run_task_planned_rows_migrated_total

Counter Rows in the run tasks that a pod completed. ClickHouse counts the rows when the migration plans the tasks. The rate is the migration throughput in rows. Query: Use the rate, summed across pods.

Terms

For the terms of the architecture, such as task and segment, see SmithDB architecture.