Skip to content

Commit ceb655f

Browse files
committed
using index_label method on pipeline counter
1 parent ec1add6 commit ceb655f

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

quickwit/quickwit-common/src/metrics.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,7 @@ impl std::fmt::Debug for GaugeGuard<'_> {
220220

221221
impl<'a> GaugeGuard<'a> {
222222
pub fn from_gauge_with_initial_value(gauge: &'a IntGauge, initial_value: i64) -> Self {
223-
let mut gauge = Self {
224-
gauge,
225-
delta: initial_value,
226-
};
223+
let mut gauge = Self { gauge, delta: 0i64 };
227224
gauge.add(initial_value);
228225
gauge
229226
}

quickwit/quickwit-indexing/src/actors/indexing_pipeline.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ impl IndexingPipeline {
158158
pub fn new(params: IndexingPipelineParams) -> Self {
159159
let indexing_pipelines_gauge = crate::metrics::INDEXER_METRICS
160160
.indexing_pipelines
161-
.with_label_values([&params.pipeline_id.index_uid.index_id]);
161+
.with_label_values([&quickwit_common::metrics::index_label(
162+
&params.pipeline_id.index_uid.index_id,
163+
)]);
162164
let indexing_pipelines_gauge_guard =
163165
OwnedGaugeGuard::from_gauge_with_initial_value(indexing_pipelines_gauge, 1);
164166
let params_fingerprint = params.params_fingerprint;

quickwit/quickwit-metastore/src/metastore/postgres/pool.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ impl<'a, DB: Database> Acquire<'a> for &TrackedPool<DB> {
5959
.set(self.inner_pool.num_idle() as i64);
6060

6161
Box::pin(async move {
62-
let mut gauge_guard = GaugeGuard::from_gauge(&POSTGRES_METRICS.acquire_connections);
63-
gauge_guard.add(1);
64-
62+
let gauge_guard = GaugeGuard::from_gauge_with_initial_value(&POSTGRES_METRICS.acquire_connections, 1);
6563
let conn = acquire_conn_fut.await?;
6664
Ok(conn)
6765
})

0 commit comments

Comments
 (0)