-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
exception/policy: add stats counters - v3.1 #10264
Conversation
We will register stats counters for all policies, even though for now Suri only uses one possible configuration policy at a time. The idea is that this could change in the near future, so we want to have this ready. Task OISF#5816
Add stats counters for exception policies applied in case of memcap hit during stream reassembly. Task OISF#5816
Counters for exception policies applied in case a stream session memcap is hit. Task OISF#5816
Stats counters for when a session is picked up midstream and Suri understands this as exception scenario. Task OISF#5816
Add defrag memcap stats counter. Task OISF#5816
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #10264 +/- ##
==========================================
- Coverage 82.28% 82.21% -0.07%
==========================================
Files 977 977
Lines 271950 272276 +326
==========================================
+ Hits 223784 223865 +81
- Misses 48166 48411 +245
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: QA ran without warnings. Pipeline 17791 |
scan-build:
|
{ | ||
uint16_t id = 0; | ||
/* for the summary values */ | ||
uint16_t g_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scan Build complaint is about this bit.
if (strstr(st->stats[u].name, "exception_policy") != NULL) { | ||
is_exception_policy_counter = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doens't look like the best way to do this. (This and what follows). Moreover, with the introduction of summary counters for App Layer error exception policy counters, maybe this isn't the best option? Not sure yet...
Thanks! This isn't what's causing the other issue, though. |
int b; | ||
int ret = ConfGetBool("stats.eps-per-app-proto-errors", &b); | ||
if (ret) { | ||
g_stats_eps_per_app_proto_errors = (b == 1); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not the best solution, but must get this config before app-layer counters setup.
if (is_exception_policy_counter && st->stats[u].value == 0 && | ||
!stats_eps_zero_counters) { | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of what causes the address sanitizer error. Removing the wrong portion of the stats, most likely.
Followed by: #10364 |
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/5816
Previous PR: #8735
Describe changes:
ignore
TODO:
Output examples:
tcp
app-layer
-> summary, logging zero values, logging per-app-proto:app-layer
-> not logging per app-proto, nor zeroes:app-layer
-> logging per app-proto, no zeroes:suricata-verify-pr: OISF/suricata-verify#1617