2022-08-04 16:46:09 +02:00
|
|
|
use lazy_static::lazy_static;
|
2022-08-08 07:41:38 +02:00
|
|
|
use prometheus::{
|
|
|
|
opts, register_histogram_vec, register_int_counter_vec, register_int_gauge,
|
2022-10-20 18:00:07 +02:00
|
|
|
register_int_gauge_vec, HistogramVec, IntCounterVec, IntGauge, IntGaugeVec,
|
2022-08-08 07:41:38 +02:00
|
|
|
};
|
2022-08-04 16:46:09 +02:00
|
|
|
|
|
|
|
lazy_static! {
|
2023-05-25 17:41:53 +02:00
|
|
|
pub static ref MEILISEARCH_HTTP_REQUESTS_TOTAL: IntCounterVec = register_int_counter_vec!(
|
|
|
|
opts!("meilisearch_http_requests_total", "Meilisearch HTTP requests total"),
|
2024-01-30 06:56:01 +01:00
|
|
|
&["method", "path", "status"]
|
2022-08-04 16:46:09 +02:00
|
|
|
)
|
|
|
|
.expect("Can't create a metric");
|
2024-03-18 18:39:05 +01:00
|
|
|
pub static ref MEILISEARCH_DEGRADED_SEARCH_REQUESTS: IntGauge = register_int_gauge!(opts!(
|
|
|
|
"meilisearch_degraded_search_requests",
|
|
|
|
"Meilisearch number of degraded search requests"
|
|
|
|
))
|
|
|
|
.expect("Can't create a metric");
|
2022-10-20 18:00:07 +02:00
|
|
|
pub static ref MEILISEARCH_DB_SIZE_BYTES: IntGauge =
|
2023-05-25 18:30:30 +02:00
|
|
|
register_int_gauge!(opts!("meilisearch_db_size_bytes", "Meilisearch DB Size In Bytes"))
|
2022-10-20 18:00:07 +02:00
|
|
|
.expect("Can't create a metric");
|
2023-05-25 18:30:30 +02:00
|
|
|
pub static ref MEILISEARCH_USED_DB_SIZE_BYTES: IntGauge = register_int_gauge!(opts!(
|
|
|
|
"meilisearch_used_db_size_bytes",
|
|
|
|
"Meilisearch Used DB Size In Bytes"
|
|
|
|
))
|
|
|
|
.expect("Can't create a metric");
|
2022-08-23 17:17:02 +02:00
|
|
|
pub static ref MEILISEARCH_INDEX_COUNT: IntGauge =
|
|
|
|
register_int_gauge!(opts!("meilisearch_index_count", "Meilisearch Index Count"))
|
|
|
|
.expect("Can't create a metric");
|
2022-08-23 17:09:27 +02:00
|
|
|
pub static ref MEILISEARCH_INDEX_DOCS_COUNT: IntGaugeVec = register_int_gauge_vec!(
|
2022-10-20 18:00:07 +02:00
|
|
|
opts!("meilisearch_index_docs_count", "Meilisearch Index Docs Count"),
|
2022-08-04 16:46:09 +02:00
|
|
|
&["index"]
|
|
|
|
)
|
|
|
|
.expect("Can't create a metric");
|
2023-05-25 17:41:53 +02:00
|
|
|
pub static ref MEILISEARCH_HTTP_RESPONSE_TIME_SECONDS: HistogramVec = register_histogram_vec!(
|
2023-06-28 11:21:50 +02:00
|
|
|
"meilisearch_http_response_time_seconds",
|
|
|
|
"Meilisearch HTTP response times",
|
2022-08-04 16:46:09 +02:00
|
|
|
&["method", "path"],
|
2024-03-25 06:37:07 +01:00
|
|
|
vec![0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0]
|
2022-08-04 16:46:09 +02:00
|
|
|
)
|
|
|
|
.expect("Can't create a metric");
|
2023-05-25 17:41:53 +02:00
|
|
|
pub static ref MEILISEARCH_NB_TASKS: IntGaugeVec = register_int_gauge_vec!(
|
|
|
|
opts!("meilisearch_nb_tasks", "Meilisearch Number of tasks"),
|
|
|
|
&["kind", "value"]
|
|
|
|
)
|
|
|
|
.expect("Can't create a metric");
|
2023-07-03 15:21:58 +02:00
|
|
|
pub static ref MEILISEARCH_LAST_UPDATE: IntGauge =
|
|
|
|
register_int_gauge!(opts!("meilisearch_last_update", "Meilisearch Last Update"))
|
|
|
|
.expect("Can't create a metric");
|
|
|
|
pub static ref MEILISEARCH_IS_INDEXING: IntGauge =
|
|
|
|
register_int_gauge!(opts!("meilisearch_is_indexing", "Meilisearch Is Indexing"))
|
|
|
|
.expect("Can't create a metric");
|
2022-08-08 07:41:38 +02:00
|
|
|
}
|