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

📝 report when query takes longer than 5 min to execute #1551

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

vjeffrey
Copy link
Contributor

Copy link
Contributor

github-actions bot commented Jan 21, 2025

Test Results

  1 files   27 suites   57s ⏱️
462 tests 461 ✅ 1 💤 0 ❌
463 runs  462 ✅ 1 💤 0 ❌

Results for commit 8213e1d.

♻️ This comment has been updated with latest results.

@@ -173,6 +173,10 @@ func (em *executionManager) executeCodeBundle(codeBundle *llx.CodeBundle, props
Str("qrid", codeID).
Dur("duration", time.Since(startTime)).
Msg("finished query execution")
if time.Since(startTime) > 5*time.Minute {
// if the query duration was more than 5 minutes, send an alert to platform
health.ReportSlowQuery("cnspec", cnspec.Version, cnspec.Build, health.SlowQueryInfo{Query: codeID, Duration: time.Since(startTime)})
Copy link
Contributor

@jaym jaym Jan 21, 2025

Choose a reason for hiding this comment

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

if we have the mql, it might make life easier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i couldnt find where to access the mql string from this context, but ya that would be awesome if we can

@vjeffrey vjeffrey force-pushed the vj/sentry-longquery branch from 326ab60 to 8213e1d Compare January 22, 2025 20:13
@vjeffrey vjeffrey merged commit a899278 into main Jan 22, 2025
15 checks passed
@vjeffrey vjeffrey deleted the vj/sentry-longquery branch January 22, 2025 20:35
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants