Skip to main content

Prometheus

RavenDB Prometheus Endpoint

The path to the Prometheus endpoint of a RavenDB instance is: /admin/monitoring/v1/prometheus
To inspect the endpoint's output using a browser, add the endpoint path to the RavenDB server's URL.
e.g., http://live-test.ravendb.net/admin/monitoring/v1/prometheus

RavenDB: Prometheus Endpoint Output

  • As Prometheus handles only numeric values, the endpoint outputs all values as numbers, providing legends that explain what the numbers mean.
    Metrics values are also explained in the table below.

On a secure server, a request to the endpoint must present a client certificate with Operator clearance or higher.
On an unsecure server, no certificate is needed.

If the server's license does not include the Monitoring Endpoints feature, requests to the endpoint fail with HTTP status 402 Payment Required.

Omit or Include Selected Metrics

Each skip* flag omits one metric group from the response when set to true; the includeGcMetrics flag adds the GC metrics, the one group that is excluded by default.
All flags default to false.

FlagMetric group
skipServerMetricsServer metrics
skipDatabasesMetricsDatabase metrics
skipIndexesMetricsIndex metrics
skipCollectionsMetricsCollection metrics
skipEtlsMetricsETL task metrics
skipAiTasksMetricsAI task metrics
skipCdcSinksMetricsCDC Sink task metrics
includeGcMetricsGC metrics (excluded by default)

e.g., to omit the index metrics:
http://localhost:8080/admin/monitoring/v1/prometheus?skipIndexesMetrics=true

To omit both the index and the server metrics:
http://localhost:8080/admin/monitoring/v1/prometheus?skipIndexesMetrics=true&skipServerMetrics=true

Metrics Provided by the Prometheus Endpoint

The following table lists the metrics that the /admin/monitoring/v1/prometheus endpoint provides.
In the endpoint's output, each name carries the ravendb_ prefix.
e.g., the server_uptime_seconds metric is exposed as ravendb_server_uptime_seconds.

The GC metrics appear only when the request sets the includeGcMetrics flag, and each carries a gckind label naming the kind of the garbage collection it describes.

MetricsDescription
ai_task_documents_processed_per_secondDocuments processed per second by the AI task (one minute rate)
ai_task_errors_countNumber of errors recorded for the AI task
ai_task_health_statusAI task health status + 0/1/2
0 => Healthy
1 => Impaired
2 => Failed
ai_task_last_successful_batch_time_in_secondsTime since the AI task's last successful batch, in seconds
archived_data_processing_behaviorArchived data processing behavior + 0/1/2
0 => ExcludeArchived
1 => IncludeArchived
2 => ArchivedOnly
available_memory_for_processing_bytesAvailable memory for processing
backup_current_number_of_running_backupsNumber of currently running backups
backup_max_number_of_concurrent_backupsMaximum number of concurrent backups
cdc_sink_errors_countNumber of errors recorded for the CDC Sink task
cdc_sink_health_statusCDC Sink task health status + 0/1/2
0 => Healthy
1 => Impaired
2 => Failed
cdc_sink_last_successful_batch_time_in_secondsTime since the CDC Sink task's last successful batch, in seconds
certificate_server_certificate_expiration_left_secondsServer certificate expiration left in seconds
cluster_current_termCluster term
cluster_indexCluster index
cluster_node_stateCurrent node state + 0/1/2
0 => Passive
1 => Candidate
2 => Follower
3 => LeaderElect
4 => Leader
collection_documents_countNumber of documents in collection
collection_documents_size_bytesSize of documents
collection_revisions_size_bytesSize of revisions
collection_tombstones_size_bytesSize of tombstones
collection_total_size_bytesTotal size of collection
cpu_assigned_processor_countNumber of assigned processors on the machine
cpu_machine_io_waitIO wait in %
cpu_machine_usageMachine CPU usage in %
cpu_process_usageProcess CPU usage in %
cpu_processor_countNumber of processors on the machine
cpu_thread_pool_available_completion_port_threadsNumber of available completion port threads in the thread pool
cpu_thread_pool_available_worker_threadsNumber of available worker threads in the thread pool
database_ai_tasks_countNumber of AI tasks in the database
database_ai_tasks_errors_countTotal number of AI task errors in the database
database_ai_tasks_failed_countNumber of AI tasks with Failed health status in the database
database_ai_tasks_healthy_countNumber of AI tasks with Healthy health status in the database
database_ai_tasks_impaired_countNumber of AI tasks with Impaired health status in the database
database_alerts_countNumber of alerts
database_attachments_countNumber of attachments
database_cdc_sinks_countNumber of CDC Sink tasks in the database
database_cdc_sinks_errors_countTotal number of CDC Sink errors in the database
database_cdc_sinks_failed_countNumber of CDC Sink tasks with Failed health status in the database
database_cdc_sinks_healthy_countNumber of CDC Sink tasks with Healthy health status in the database
database_cdc_sinks_impaired_countNumber of CDC Sink tasks with Impaired health status in the database
database_documents_countNumber of documents
database_etls_countNumber of ETL tasks in the database
database_etls_errors_countTotal number of ETL errors in the database
database_etls_failed_countNumber of ETL tasks with Failed health status in the database
database_etls_healthy_countNumber of ETL tasks with Healthy health status in the database
database_etls_impaired_countNumber of ETL tasks with Impaired health status in the database
database_indexes_auto_countNumber of auto indexes
database_indexes_countNumber of indexes
database_indexes_errored_countNumber of error indexes
database_indexes_disabled_countNumber of disabled indexes
database_indexes_errors_countNumber of indexing errors
database_indexes_idle_countNumber of idle indexes
database_indexes_stale_countNumber of stale indexes
database_indexes_static_countNumber of static indexes
database_performance_hints_countNumber of performance hints
database_rehabs_countNumber of rehabs
database_replication_factorDatabase replication factor
database_revisions_countNumber of revision documents
database_statistics_doc_puts_per_secondNumber of document puts per second (one minute rate)
database_statistics_map_index_indexes_per_secondNumber of indexed documents per second for map indexes (one minute rate)
database_statistics_map_reduce_index_mapped_per_secondNumber of maps per second for map-reduce indexes (one minute rate)
database_statistics_map_reduce_index_reduced_per_secondNumber of reduces per second for map-reduce indexes (one minute rate)
database_statistics_request_average_duration_secondsAverage request time in seconds
database_statistics_requests_countNumber of requests from database start
database_statistics_requests_per_secondNumber of requests per second (one minute rate)
database_storage_documents_allocated_data_file_bytesDocuments storage allocated size
database_storage_documents_used_data_file_bytesDocuments storage used size
database_storage_indexes_allocated_data_file_bytesIndex storage allocated size
database_storage_indexes_used_data_file_bytesIndex storage used size
database_storage_io_read_operationsDisk IO Read operations
database_storage_io_write_operationsDisk IO Write operations
database_storage_queue_lengthDisk Queue length
database_storage_read_throughput_bytesDisk Read Throughput
database_storage_total_allocated_storage_file_bytesTotal storage size
database_storage_total_free_space_bytesRemaining storage disk space
database_storage_write_throughput_bytesDisk Write Throughput
database_time_since_last_backup_secondsLast backup
database_unique_attachments_countNumber of unique attachments
database_uptime_secondsDatabase up-time
databases_loaded_countNumber of loaded databases
databases_total_countNumber of all databases
etl_documents_processed_per_secondDocuments processed per second by the ETL task (one minute rate)
etl_errors_countNumber of errors recorded for the ETL task
etl_health_statusETL task health status + 0/1/2
0 => Healthy
1 => Impaired
2 => Failed
etl_last_successful_batch_time_in_secondsTime since the ETL task's last successful batch, in seconds
gc_compactedIndicates if the last garbage collection was compacting (1 = yes, 0 = no)
gc_concurrentIndicates if the last garbage collection was concurrent (1 = yes, 0 = no)
gc_finalization_pending_countNumber of objects pending finalization observed during the last garbage collection
gc_fragmented_mbHeap fragmentation in MB after the last garbage collection
gc_generationGeneration collected by the last garbage collection
gc_heap_size_mbTotal GC heap size in MB after the last garbage collection
gc_high_memory_load_threshold_mbHigh memory load threshold in MB at the time of the last garbage collection
gc_indexIndex of the last garbage collection
gc_memory_load_mbMemory load in MB at the time of the last garbage collection
gc_pause_durations_1_secondsFirst GC pause duration in seconds recorded during the last garbage collection
gc_pause_durations_2_secondsSecond GC pause duration in seconds recorded during the last garbage collection
gc_pause_time_percentagePercentage of time spent paused for GC since the previous collection
gc_pinned_objects_countNumber of pinned objects observed during the last garbage collection
gc_promoted_mbMemory promoted during the last garbage collection in MB
gc_total_available_memory_mbTotal available memory for the GC in MB at the time of the last garbage collection
gc_total_committed_mbTotal committed managed heap size in MB after the last garbage collection
index_entries_countNumber of entries in the index
index_errorsNumber of index errors
index_is_invalidIndicates if index is invalid
index_lock_modeIndex lock mode + 0/1/2
0 => Unlock
1 => LockedIgnore
2 => LockedError
index_mapped_per_secondNumber of maps per second (one minute rate)
index_priorityIndex priority + 0/1/2
0 => Low
1 => Normal
2 => High
index_reduced_per_secondNumber of reduces per second (one minute rate)
index_stateIndex state + 0/1/2/3
0 => Normal
1 => Disabled
2 => Idle
3 => Error
index_statusIndex status + 0/1/2/3
0 => Running
1 => Paused
2 => Disabled
3 => Pending (for rolling indexes)
index_time_since_last_indexing_secondsTime since last indexing
index_time_since_last_query_secondsTime since last query
index_typeIndex type + 0/1/2/3/4/5/6/7
0 => None
1 => AutoMap
2 => AutoMapReduce
3 => Map
4 => MapReduce
5 => Faulty
6 => JavaScriptMap
7 => JavaScriptMapReduce
license_expiration_left_secondsServer license expiration left
license_max_coresServer license max CPU cores
license_typeServer license type + -1/0/1/2/3/4/5/6/7
-1 => Invalid
0 => None
1 => Community
2 => Reserved
3 => Professional
4 => Enterprise
5 => Developer
6 => Essential
7 => EnterpriseAi
license_utilized_cpu_coresServer license utilized CPU cores
managed_memory_bytesServer managed memory size
memory_allocated_bytesServer allocated memory
memory_installed_bytesInstalled memory
memory_low_memory_severityServer low memory flag value + 0/1/2
0 => None
1 => Low
2 => ExtremelyLow
memory_physical_bytesPhysical memory
memory_total_dirty_bytesDirty memory that is used by the scratch buffers
memory_total_swap_size_bytesServer total swap size
memory_total_swap_usage_bytesServer total swap usage
memory_working_set_swap_usage_bytesServer working set swap usage
network_concurrent_requests_countNumber of concurrent requests
network_last_authorized_non_cluster_admin_request_time_in_secServer last authorized non cluster admin request time
network_last_request_time_in_secondsServer last request time
network_requests_per_secondNumber of requests per second (one minute rate)
network_tcp_active_connectionsNumber of active TCP connections
network_total_requestsTotal number of requests since server startup
server_ai_tasks_countTotal number of AI tasks across all databases
server_ai_tasks_errors_countTotal number of AI task errors across all databases
server_ai_tasks_failed_countNumber of AI tasks with Failed health status across all databases
server_ai_tasks_healthy_countNumber of AI tasks with Healthy health status across all databases
server_ai_tasks_impaired_countNumber of AI tasks with Impaired health status across all databases
server_cdc_sinks_countTotal number of CDC Sink tasks across all databases
server_cdc_sinks_errors_countTotal number of CDC Sink errors across all databases
server_cdc_sinks_failed_countNumber of CDC Sink tasks with Failed health status across all databases
server_cdc_sinks_healthy_countNumber of CDC Sink tasks with Healthy health status across all databases
server_cdc_sinks_impaired_countNumber of CDC Sink tasks with Impaired health status across all databases
server_disk_remaining_storage_space_percentageRemaining server storage disk space in %
server_disk_system_store_total_data_file_size_bytesServer storage total size
server_disk_system_store_used_data_file_size_bytesServer storage used size
server_etls_countTotal number of ETL tasks across all databases
server_etls_errors_countTotal number of ETL errors across all databases
server_etls_failed_countNumber of ETL tasks with Failed health status across all databases
server_etls_healthy_countNumber of ETL tasks with Healthy health status across all databases
server_etls_impaired_countNumber of ETL tasks with Impaired health status across all databases
server_infoServer Info
server_process_idServer process ID
server_storage_io_read_operationsDisk IO Read operations
server_storage_io_write_operationsDisk IO Write operations
server_storage_queue_lengthDisk Queue length
server_storage_read_throughput_bytesDisk Read Throughput
server_storage_total_free_space_bytesRemaining storage disk space
server_storage_write_throughput_bytesDisk Write Throughput
server_uptime_secondsServer up-time
unmanaged_memory_bytesServer unmanaged memory size

Using the RavenDB Endpoint by a Prometheus Server

Configuring and running Prometheus

To direct a Prometheus server to the Prometheus endpoint of a RavenDB instance, add a scrape job for the RavenDB server under the scrape_configs section of the prometheus.yml configuration file.
The following sample defines two scrape jobs: one for a local unsecure server, and one for three secure nodes of a cloud cluster.

scrape_configs:
- job_name: "local-raven-instance"
# Monitor a local, unsecure RavenDB server
metrics_path: "/admin/monitoring/v1/prometheus"
static_configs:
- targets:
- "localhost:8080"

- job_name: "cloud-raven-instance"
# Monitor 3 RavenDB nodes on the cloud
scheme: https
tls_config:
cert_file: "a.client.certificate.crt"
key_file: "a.client.certificate.key"
metrics_path: "/admin/monitoring/v1/prometheus"
static_configs:
- targets:
- "a.cloudtest.ravendb.org"
- "b.cloudtest.ravendb.org"
- "c.cloudtest.ravendb.org"

To load the scrape jobs, run the Prometheus server and point it at your prometheus.yml file:
./prometheus --config.file=prometheus.yml

Browsing the metrics in Prometheus

Once the Prometheus server is running, you can browse and graph the RavenDB metrics it collects.

Typing raven in the search bar lists the metrics the RavenDB endpoint provides:

Prometheus: Select Metrics

Executing a query over a metric plots its values over time in the Graph tab.
e.g., the RavenDB server's CPU usage:

Prometheus: Metrics Graph

Reading the endpoint output directly

You can also read the metrics directly from RavenDB's endpoint output, without Prometheus: open the endpoint URL in your browser, as described under RavenDB Prometheus Endpoint.
In the following endpoint output, the priority of one of the indexes was updated to 2 (high):

RavenDB Endpoint Output: Index Priority

Querying the metric's name in Prometheus displays the change graphically:

Prometheus Server: Index Priority

Fetching Additional RavenDB Information

To retrieve additional information about RavenDB, including its version and its HTTP and TCP URLs, query ravendb_server_info in Prometheus:

Additional Information

In this article