Skip to content

Commit

Permalink
[Agent] Fix that some queues in grafana do not have monitoring data
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchaoa committed Mar 1, 2024
1 parent 0f9a687 commit 1def397
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 26 deletions.
65 changes: 40 additions & 25 deletions agent/src/trident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1459,10 +1459,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag(
"module",
l4_flow_aggr_queue_name.to_string(),
)],
vec![
StatsOption::Tag("module", l4_flow_aggr_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let l4_flow_uniform_sender = UniformSenderThread::new(
l4_flow_aggr_queue_name,
Expand All @@ -1482,7 +1482,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag("module", metrics_queue_name.to_string())],
vec![
StatsOption::Tag("module", metrics_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let metrics_uniform_sender = UniformSenderThread::new(
metrics_queue_name,
Expand Down Expand Up @@ -1571,10 +1574,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag(
"module",
packet_sequence_queue_name.to_string(),
)],
vec![
StatsOption::Tag("module", packet_sequence_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let packet_sequence_uniform_sender = UniformSenderThread::new(
packet_sequence_queue_name,
Expand Down Expand Up @@ -1630,7 +1633,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(pcap_batch_counter)),
vec![StatsOption::Tag("module", pcap_batch_queue.to_string())],
vec![
StatsOption::Tag("module", pcap_batch_queue.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let pcap_batch_uniform_sender = UniformSenderThread::new(
pcap_batch_queue,
Expand Down Expand Up @@ -1893,10 +1899,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag(
"module",
proc_event_queue_name.to_string(),
)],
vec![
StatsOption::Tag("module", proc_event_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let proc_event_uniform_sender = UniformSenderThread::new(
proc_event_queue_name,
Expand Down Expand Up @@ -1996,7 +2002,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag("module", otel_queue_name.to_string())],
vec![
StatsOption::Tag("module", otel_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let otel_uniform_sender = UniformSenderThread::new(
otel_queue_name,
Expand Down Expand Up @@ -2044,10 +2053,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag(
"module",
prometheus_queue_name.to_string(),
)],
vec![
StatsOption::Tag("module", prometheus_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let prometheus_uniform_sender = UniformSenderThread::new(
prometheus_queue_name,
Expand All @@ -2067,7 +2076,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag("module", telegraf_queue_name.to_string())],
vec![
StatsOption::Tag("module", telegraf_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let telegraf_uniform_sender = UniformSenderThread::new(
telegraf_queue_name,
Expand All @@ -2087,7 +2099,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag("module", profile_queue_name.to_string())],
vec![
StatsOption::Tag("module", profile_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let profile_uniform_sender = UniformSenderThread::new(
profile_queue_name,
Expand All @@ -2107,10 +2122,10 @@ impl AgentComponents {
stats_collector.register_countable(
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag(
"module",
compressed_otel_queue_name.to_string(),
)],
vec![
StatsOption::Tag("module", compressed_otel_queue_name.to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
let compressed_otel_uniform_sender = UniformSenderThread::new(
compressed_otel_queue_name,
Expand Down
5 changes: 4 additions & 1 deletion agent/src/utils/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ impl Collector {
&s,
"queue",
Countable::Owned(Box::new(counter)),
vec![StatsOption::Tag("module", "0-stats-to-sender".to_string())],
vec![
StatsOption::Tag("module", "0-stats-to-sender".to_string()),
StatsOption::Tag("index", "0".to_string()),
],
);
return s;
}
Expand Down

0 comments on commit 1def397

Please sign in to comment.