-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
metrics.go
support for metadata queries(labels and series)
#5971
metrics.go
support for metadata queries(labels and series)
#5971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want any additional stats fields for these queries? the # of results for example
Good point. I think that would really be helpful. Let me try adding it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well, there's just a lint issue it looks like.
Thanks for implementing this Kavi. I learned a thing or two about how the stats collection is implemented while reviewing.
I'm facing one weird panic during some series API call. Investigating. |
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach is looking good. As you mentioned, we'll need to find/fix the panic and do some linting.
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
// now assuming path has suffix `/values` label name should be second last to the suffix | ||
// **if** there exists the second last. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we include a link to the docs for this endpoint? https://grafana.com/docs/loki/latest/api/#get-lokiapiv1labelnamevalues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does / why we need it:
We use
metrics.go
(a convention) to record some useful statistics about each of theinstance
andrange
queries.So that we can query something like
{foo="bar"}|= "metrics.go" |logfmt|latency=slow
Where
latency
comes from statistics recorded inpkg/logql/metric.go
.This PR add support those experience for series and labels API as well.
Examples:
Generates following log lines via
metrics.go
Generates following log lines via
metrics.go
Generates following log lines via
metrics.go
Which issue(s) this PR fixes:
Fixes #4503
Special notes for your reviewer:
Checklist
CHANGELOG.md
about the changes.Future Work
latency=slow|fast
label from metric.go entries.returned_lines
whenquery_type=filtered
. Because now we havetotal_entries
common for all thequery_type
.