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

Add slow query logger based on Doobie #4993

Merged
merged 5 commits into from
May 22, 2024

Conversation

imsdu
Copy link
Contributor

@imsdu imsdu commented May 22, 2024

Example of log:

2024-05-22 09:48:14 WARN  c.e.b.n.d.sourcing.QueryLogHandler - [StreamingPool] Slow Statement Execution:

 ((SELECT 'newState', type, id, org, project, value, instant, ordering, rev
  FROM public.scoped_states
  WHERE org = ? and project = ?  AND ordering > ?  AND tag = ? 
  ORDER BY ordering
  LIMIT ?)
  UNION ALL
  (SELECT 'tombstone', type, id, org, project, null, instant, ordering, -1
  FROM public.scoped_tombstones
  WHERE org = ? and project = ?  AND ordering > ?  AND tag = ?  AND (cause->>'deleted' = 'true' ) 
  ORDER BY ordering
  LIMIT ?)
  ORDER BY ordering)
  LIMIT ?

 arguments = [mbodytmoxbxk0do, n5rspxio3rlet3w, 184, latest, 30, mbodytmoxbxk0do, n5rspxio3rlet3w, 184, latest, 30, 30]
 label     = unlabeled
 elapsed = 11 ms exec + 0 ms processing (11 ms total)

So we have the arguments now to make it easier

@@ -912,7 +912,6 @@ lazy val kamonSettings = Seq(
"io.kamon" %% "kamon-core" % kamonVersion,
"io.kamon" %% "kamon-executors" % kamonVersion,
"io.kamon" %% "kamon-jaeger" % kamonVersion,
"io.kamon" %% "kamon-jdbc" % kamonVersion,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Slow query logging was the only feature we used from it so we can just get rid of it now

@imsdu imsdu merged commit 6d86ba8 into BlueBrain:master May 22, 2024
9 checks passed
@imsdu imsdu deleted the add-slow-query-logger branch May 22, 2024 12:45
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.

2 participants