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

Log when a query is received. #6849

Open
slim-bean opened this issue Aug 8, 2022 · 1 comment
Open

Log when a query is received. #6849

slim-bean opened this issue Aug 8, 2022 · 1 comment
Labels
operational/stability operational Used internally by Grafana Labs to help organize, added to tasks we put in our on-call workqueue.

Comments

@slim-bean
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

There are several places in Loki where we log the outcome of a query, however there are several cases where a query may never finish and no log output is created (one example may be an OOM crash of a querier).

Describe the solution you'd like

Similar to how we do the push request parsed line for writes:

level.Debug(logger).Log(
"msg", "push request parsed",
"path", r.URL.Path,
"contentType", contentType,
"contentEncoding", contentEncoding,
"bodySize", humanize.Bytes(uint64(bodySize.Size())),
"streams", len(req.Streams),
"entries", totalEntries,
"streamLabelsSize", humanize.Bytes(uint64(streamLabelsSize)),
"entriesSize", humanize.Bytes(uint64(entriesSize)),
"totalSize", humanize.Bytes(uint64(entriesSize+streamLabelsSize)),
"mostRecentLagMs", time.Since(mostRecentEntry).Milliseconds(),
)

I think we should have something similar for queries, as soon as Loki receives the query we should log information about it.

@slim-bean slim-bean added the operational Used internally by Grafana Labs to help organize, added to tasks we put in our on-call workqueue. label Aug 8, 2022
@JordanRushing JordanRushing self-assigned this Aug 10, 2022
@dannykopping
Copy link
Contributor

dannykopping commented Oct 31, 2022

We have this partially implemented #7469

We still need this for metadata queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operational/stability operational Used internally by Grafana Labs to help organize, added to tasks we put in our on-call workqueue.
Projects
None yet
Development

No branches or pull requests

3 participants