Skip to content

Commit 5447630

Browse files
committed
Remove action digest and worker id from analytics.
1 parent 28912a1 commit 5447630

3 files changed

Lines changed: 5 additions & 31 deletions

File tree

nativelink-scheduler/src/memory_awaited_action_db.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ impl<I: InstantWrapper, NowFn: Fn() -> I + Clone + Send + Sync> AwaitedActionDbI
660660
// Track stage transitions
661661
let base_attrs = make_execution_attributes(
662662
"unknown",
663-
None,
664663
Some(old_awaited_action.action_info().priority),
665664
);
666665
metrics.execution_stage_transitions.add(1, &base_attrs);
@@ -691,10 +690,6 @@ impl<I: InstantWrapper, NowFn: Fn() -> I + Clone + Send + Sync> AwaitedActionDbI
691690
ExecutionResult::Failure
692691
},
693692
),
694-
opentelemetry::KeyValue::new(
695-
nativelink_util::metrics::EXECUTION_ACTION_DIGEST,
696-
action_digest,
697-
),
698693
];
699694
metrics.execution_completed_count.add(1, &result_attrs);
700695
} else if let ActionStage::CompletedFromCache(_) = new_stage {
@@ -703,10 +698,6 @@ impl<I: InstantWrapper, NowFn: Fn() -> I + Clone + Send + Sync> AwaitedActionDbI
703698
nativelink_util::metrics::EXECUTION_RESULT,
704699
ExecutionResult::CacheHit,
705700
),
706-
opentelemetry::KeyValue::new(
707-
nativelink_util::metrics::EXECUTION_ACTION_DIGEST,
708-
action_digest,
709-
),
710701
];
711702
metrics.execution_completed_count.add(1, &result_attrs);
712703
}
@@ -817,7 +808,7 @@ impl<I: InstantWrapper, NowFn: Fn() -> I + Clone + Send + Sync> AwaitedActionDbI
817808

818809
// Record metric for new action entering the queue
819810
let metrics = &*EXECUTION_METRICS;
820-
let _base_attrs = make_execution_attributes("unknown", None, Some(action_info.priority));
811+
let _base_attrs = make_execution_attributes("unknown", Some(action_info.priority));
821812
let queued_attrs = vec![opentelemetry::KeyValue::new(
822813
nativelink_util::metrics::EXECUTION_STAGE,
823814
ExecutionStage::Queued,

nativelink-scheduler/src/simple_scheduler_state_manager.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,11 @@ impl SchedulerMetrics {
156156
}
157157

158158
#[must_use]
159-
pub fn make_worker_attrs(&self, worker_id: Option<&WorkerId>) -> Vec<KeyValue> {
160-
let mut attrs = vec![KeyValue::new(
159+
pub fn make_worker_attrs(&self) -> Vec<KeyValue> {
160+
vec![KeyValue::new(
161161
EXECUTION_INSTANCE,
162162
self.instance_name.clone(),
163-
)];
164-
if let Some(worker_id) = worker_id {
165-
attrs.push(KeyValue::new(
166-
nativelink_util::metrics::EXECUTION_WORKER_ID,
167-
worker_id.to_string(),
168-
));
169-
}
170-
attrs
163+
)]
171164
}
172165

173166
#[must_use]
@@ -1203,7 +1196,6 @@ where
12031196
// Build base attributes for metrics
12041197
let mut attrs = nativelink_util::metrics::make_execution_attributes(
12051198
instance_name,
1206-
worker_id.as_deref(),
12071199
priority,
12081200
);
12091201

nativelink-util/src/metrics.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
use std::fmt::{Display, Formatter};
1818
use std::sync::{LazyLock, OnceLock};
1919

20-
use opentelemetry::{InstrumentationScope, KeyValue, Value, global, metrics};
21-
use tokio::time::Instant;
2220
use crate::action_messages::ActionStage;
23-
use crate::metrics_utils::Counter;
21+
use opentelemetry::{global, metrics, InstrumentationScope, KeyValue, Value};
2422

2523
/// Callback type for observable gauges that report queued action counts.
2624
/// The callback receives an `Observer` that should be used to record values with attributes.
@@ -67,9 +65,7 @@ pub const EXECUTION_STAGE: &str = "execution_stage";
6765
pub const EXECUTION_RESULT: &str = "execution_result";
6866
pub const EXECUTION_INSTANCE: &str = "execution_instance";
6967
pub const EXECUTION_PRIORITY: &str = "execution_priority";
70-
pub const EXECUTION_WORKER_ID: &str = "execution_worker_id";
7168
pub const EXECUTION_EXIT_CODE: &str = "execution_exit_code";
72-
pub const EXECUTION_ACTION_DIGEST: &str = "execution_action_digest";
7369

7470
/// Cache operation types for metrics classification.
7571
#[derive(Debug, Clone, Copy)]
@@ -690,15 +686,10 @@ pub struct ExecutionMetrics {
690686
#[must_use]
691687
pub fn make_execution_attributes(
692688
instance_name: &str,
693-
worker_id: Option<&str>,
694689
priority: Option<i32>,
695690
) -> Vec<KeyValue> {
696691
let mut attrs = vec![KeyValue::new(EXECUTION_INSTANCE, instance_name.to_string())];
697692

698-
if let Some(worker_id) = worker_id {
699-
attrs.push(KeyValue::new(EXECUTION_WORKER_ID, worker_id.to_string()));
700-
}
701-
702693
if let Some(priority) = priority {
703694
attrs.push(KeyValue::new(EXECUTION_PRIORITY, i64::from(priority)));
704695
}

0 commit comments

Comments
 (0)