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

internal/appsec/emitter/waf: reduce rate limiting log spam #2888

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nsrip-dd
Copy link
Contributor

@nsrip-dd nsrip-dd commented Sep 25, 2024

What does this PR do?

WIP: my first approach (add a "limited" field to the operation) was wrong
since the rate limiter is a global thing and each benchmark iteration is a new "operation"

The ContextOperation.AddEvent method logs a warning if the
ContextOperation's rate limit is hit. If there are a burst of calls to
AddEvent, this means there will be a corresponding burst of logs. This
happens for example when running BenchmarkGraphQL on the benchmarking
platform. Only the first log is really useful.

Motivation

Not sure how much it affects users. But I think it's making our microbenchmark
runs slow? That's where I noticed the log spam. Example pipeline

The ContextOperation.AddEvent method logs a warning if the
ContextOperation's rate limit is hit. If there are a burst of calls to
AddEvent, this means there will be a corresponding burst of logs. This
happens for example when running BenchmarkGraphQL on the benchmarking
platform. Only the first log is really useful.
@pr-commenter
Copy link

pr-commenter bot commented Sep 25, 2024

Benchmarks

Benchmark execution time: 2024-09-25 15:15:24

Comparing candidate commit c6dfc42 in PR branch nick.ripley/reduce-waf-rate-limit-logs with baseline commit 7699f9e in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 0 unstable metrics.

scenario:BenchmarkInjectW3C-24

  • 🟩 execution_time [-178.231ns; -146.569ns] or [-4.272%; -3.513%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant