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

Dedicated whitelist metrics #2813

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Dedicated whitelist metrics #2813

merged 5 commits into from
Feb 6, 2024

Conversation

buixor
Copy link
Contributor

@buixor buixor commented Feb 6, 2024

  • track whitelists effect (hits/whitelists)
  • dedicated cscli metrics table
  • adding a whitelisted column to existing acquis metrics/table

dedicated table

Whitelist Metrics:
╭────────────────────────────────┬────────────────────────┬──────┬─────────────╮
│           Whitelist            │         Reason         │ Hits │ Whitelisted │
├────────────────────────────────┼────────────────────────┼──────┼─────────────┤
│ child-crowdsecurity/whitelists │ local ipv6 ip/ranges   │ 20   │ -           │
│ child-crowdsecurity/whitelists │ private ipv4 ip/ranges │ 20   │ 10          │
╰────────────────────────────────┴────────────────────────┴──────┴─────────────╯

addition to acquis metrics

cquisition Metrics:
╭─────────────────┬────────────┬──────────────┬────────────────┬────────────────────────┬───────────────────╮
│     Source      │ Lines read │ Lines parsed │ Lines unparsed │ Lines poured to bucket │ Lines whitelisted │
├─────────────────┼────────────┼──────────────┼────────────────┼────────────────────────┼───────────────────┤
│ file:/tmp/x.log │ 20         │ 20           │ -              │ 22                     │ 10                │
╰─────────────────┴────────────┴──────────────┴────────────────┴────────────────────────┴───────────────────╯

… acquis metrics to track discarded/whitelisted lines
Copy link

github-actions bot commented Feb 6, 2024

@buixor: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

github-actions bot commented Feb 6, 2024

@buixor: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link
Contributor

@LaurenceJJones LaurenceJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but failing CI due to legacy complexity

@buixor
Copy link
Contributor Author

buixor commented Feb 6, 2024

/area cscli
/kind enhancement

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 66 lines in your changes are missing coverage. Please review.

Comparison is base (4e724f6) 57.63% compared to head (0195781) 37.52%.

❗ Current head 0195781 differs from pull request most recent head bbeb3c4. Consider uploading reports for the commit bbeb3c4 to get more accurate results

Files Patch % Lines
cmd/crowdsec-cli/metrics_table.go 41.66% 31 Missing and 4 partials ⚠️
cmd/crowdsec-cli/metrics.go 40.54% 22 Missing ⚠️
pkg/parser/whitelist.go 27.27% 8 Missing ⚠️
cmd/crowdsec/metrics.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2813       +/-   ##
===========================================
- Coverage   57.63%   37.52%   -20.11%     
===========================================
  Files         238      234        -4     
  Lines       30784    30483      -301     
===========================================
- Hits        17742    11439     -6303     
- Misses      11396    17736     +6340     
+ Partials     1646     1308      -338     
Flag Coverage Δ
bats 37.52% <41.07%> (-0.05%) ⬇️
unit-linux ?
unit-windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@buixor buixor merged commit 3208a40 into master Feb 6, 2024
15 checks passed
@buixor buixor deleted the improve_whitelists_metrics branch February 6, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cscli kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants