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

[Monitoring] Adding instrumentation for bugs opened/closed #4322

Merged
merged 10 commits into from
Oct 14, 2024

Conversation

vitorguidi
Copy link
Collaborator

@vitorguidi vitorguidi commented Oct 11, 2024

Motivation

Opening and closing bugs is the last step in the clusterfuzz user journey, and we currently do not have that instrumentation. This PR:

  • Enables monitoring in the kubernetes environment
  • Enables monitoring on cron jobs
  • Moves the wrap_with_monitoring context manager from run_bot.py to monitoring.py, so it can get reused in run_cron.py
  • Collects bugs opened metrics from the triage cronjob
  • Collects bugs closed metrics from the cleanup cronjob

The only relevant label for these metrics is the fuzzer name.

For bug filing, we measure how many attempts:

  • Succeeded
  • Failed
  • Got throttled

For bug closing, we measure how many attempts:

  • Succeeded
  • Failed

Part of #4271

@vitorguidi vitorguidi changed the title Feature/bugs metrics Adding instrumentation for bugs opened/closed Oct 11, 2024
@@ -261,6 +261,7 @@ def _file_issue(testcase, issue_tracker, throttler):

if throttler.should_throttle(testcase):
_add_triage_message(testcase, 'Skipping filing as it is throttled.')
monitoring_metrics.ISSUE_FILING_THROTTLED.increment({'fuzzer_name': testcase.fuzzer_name})
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One alternative would be to have a single ISSUE_FILLING metric, and a label to indicate throttled/success/failure, to define less metric types.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it might be more convenient to have a single issue_filing metric with 3 possible values (success, failure, throttling). Same for ISSUE_CLOSING which can have two values(success, failure)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will send a followup one to simplify this.

@vitorguidi vitorguidi force-pushed the feature/bugs-metrics branch from ad06754 to b2be3ef Compare October 14, 2024 19:30
@vitorguidi vitorguidi merged commit 3df5dfd into master Oct 14, 2024
7 checks passed
@vitorguidi vitorguidi deleted the feature/bugs-metrics branch October 14, 2024 20:32
vitorguidi added a commit that referenced this pull request Oct 16, 2024
@vitorguidi vitorguidi changed the title Adding instrumentation for bugs opened/closed [Monitoring] Instrumenting cronjob exit codesAdding instrumentation for bugs opened/closed Nov 8, 2024
@vitorguidi vitorguidi changed the title [Monitoring] Instrumenting cronjob exit codesAdding instrumentation for bugs opened/closed [Monitoring] Adding instrumentation for bugs opened/closed Nov 8, 2024
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.

3 participants