Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AGENT] Fix duplicated flow map allocator stats counter #4467

Merged
merged 8 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions agent/src/flow_generator/flow_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ impl FlowMap {
stats_collector.register_countable(
"allocator",
Countable::Ref(allocator.counter()),
vec![StatsOption::Tag("type", "TaggedFlow".to_owned())],
vec![
StatsOption::Tag("type", "TaggedFlow".to_owned()),
StatsOption::Tag("id", format!("{}", id)),
],
);
allocator
},
Expand All @@ -300,7 +303,10 @@ impl FlowMap {
stats_collector.register_countable(
"allocator",
Countable::Ref(allocator.counter()),
vec![StatsOption::Tag("type", "L7Stats".to_owned())],
vec![
StatsOption::Tag("type", "L7Stats".to_owned()),
StatsOption::Tag("id", format!("{}", id)),
],
);
allocator
},
Expand Down
2 changes: 1 addition & 1 deletion agent/src/utils/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Collector {
let equals = s == &source;
if !closed && equals {
warn!(
"Possible memory leak! countable {} is not correctly closed.",
"Found duplicated counter source {}, please check if the old one is correctly closed.",
source
);
}
Expand Down