fix: disable path label in opendal for now (#5247)

* fix: remove path label in opendal for now

* fix: typo

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>

---------

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
shuiyisong
2024-12-27 12:34:19 +08:00
committed by Yingwen
parent ed8c072a5e
commit 589cc84048

View File

@@ -30,13 +30,18 @@ mod prometheus {
/// pattern `<data|index>/catalog/schema/table_id/...` OR `greptimedb/object_cache/<read|write>/...`
///
/// We'll get the data/catalog/schema from path.
pub fn build_prometheus_metrics_layer(with_path_label: bool) -> PrometheusLayer {
pub fn build_prometheus_metrics_layer(_with_path_label: bool) -> PrometheusLayer {
PROMETHEUS_LAYER
.get_or_init(|| {
let path_level = if with_path_label { 3 } else { 0 };
// let path_level = if with_path_label { 3 } else { 0 };
// opendal doesn't support dynamic path label trim
// we have uuid in index path, which causes the label size to explode
// remove path label first, waiting for later fix
// TODO(shuiyisong): add dynamic path label trim for opendal
let layer = PrometheusLayer::builder()
.path_label(path_level)
.path_label(0)
.register_default()
.unwrap();