@@ -23,6 +23,7 @@ use quickwit_actors::{
2323 QueueCapacity , Supervisable ,
2424} ;
2525use quickwit_common:: KillSwitch ;
26+ use quickwit_common:: metrics:: OwnedGaugeGuard ;
2627use quickwit_common:: pubsub:: EventBroker ;
2728use quickwit_common:: temp_dir:: TempDirectory ;
2829use quickwit_config:: { IndexingSettings , RetentionPolicy , SourceConfig } ;
@@ -120,6 +121,7 @@ pub struct IndexingPipeline {
120121 // requiring a respawn of the pipeline.
121122 // We keep the list of shards here however, to reassign them after a respawn.
122123 shard_ids : BTreeSet < ShardId > ,
124+ _indexing_pipelines_gauge_guard : OwnedGaugeGuard ,
123125}
124126
125127#[ async_trait]
@@ -154,6 +156,10 @@ impl Actor for IndexingPipeline {
154156
155157impl IndexingPipeline {
156158 pub fn new ( params : IndexingPipelineParams ) -> Self {
159+ let indexing_pipelines_gauge = crate :: metrics:: INDEXER_METRICS
160+ . indexing_pipelines
161+ . with_label_values ( [ & params. pipeline_id . index_uid . index_id ] ) ;
162+ let indexing_pipelines_gauge_guard = OwnedGaugeGuard :: from_gauge ( indexing_pipelines_gauge) ;
157163 let params_fingerprint = params. params_fingerprint ;
158164 IndexingPipeline {
159165 params,
@@ -165,6 +171,7 @@ impl IndexingPipeline {
165171 ..Default :: default ( )
166172 } ,
167173 shard_ids : Default :: default ( ) ,
174+ _indexing_pipelines_gauge_guard : indexing_pipelines_gauge_guard,
168175 }
169176 }
170177
0 commit comments