influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

must set query-log-enabled = true when want to log slow query only.

Open stanxing opened this issue 7 years ago • 8 comments

Bug report

Influxdb version = 1.3.5

I must set 'query-log-enabled = true' when I want to log slow query.

when I configure the influxdb.conf below: influxdb.conf [data] ... query-log-enabled = false

[coordinator] query-timeout = "60s" log-queries-after = "10ms"

The result is that influxdb didn't ouput log about any query. Then I set query-log-enabled = true, I can see all query log including 'slow query log'. I think it is not reasonable. May be have any better workaround to log slow query only?

stanxing avatar Sep 27 '17 10:09 stanxing

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 24 '19 08:07 stale[bot]

This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.

stale[bot] avatar Jul 31 '19 09:07 stale[bot]

Guess that a doc notice for log-queries-after will be enough to workaround this issue in many cases.

TriAnMan avatar Oct 15 '19 12:10 TriAnMan

@dgnorton could you maybe reopen the issue? Is there a way to log the slow queries, without logging all queries? If not, then I believe this is still a valid issue.

jimis avatar Dec 06 '19 15:12 jimis

@jimis did you try setting log-queries-after? https://docs.influxdata.com/influxdb/v1.7/troubleshooting/query_management/#log-queries-after

dgnorton avatar Dec 06 '19 15:12 dgnorton

Yes of course, I have set it to log-queries-after = 1s together with query-log-enabled = false. It's not clear from the page you linked, if that combination works. I assumed it doesn't after finding this bug report.

jimis avatar Dec 06 '19 15:12 jimis

This is apparently still an issue in version 1.9.3. Will there be a fix?

nilsgaeq avatar Sep 01 '21 09:09 nilsgaeq

This is still an issue in version 1.9.5 , when we set [data] ... query-log-enabled = true [coordinator] query-timeout = "60s" log-queries-after = "2ms"

It logs all the queries even which are shorter than 2ms.

Hitesh-Agrawal avatar Jun 24 '22 08:06 Hitesh-Agrawal