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

Loki: Add optional stream selector to fetchLabelValues API #77207

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

ivanahuckova
Copy link
Member

In this PR, we are adding optional options to fetchLabelValues with possibility to specify streamSelector. The API for fetching label values includes options to add query which is basically streamSelector (I decided to name parameter streamSelector cause query is vague and we can't include things like parsers or other operations) https://grafana.com/docs/loki/latest/reference/api/#list-label-values-within-a-range-of-time

The reason why we are creating options rather than just passing streamSelector as second parameter is because in the future we could expand this to other things, such as specifying custom timeRange or something else.

This was requested by @trevorwhitney to help them develop app plugin.

@github-actions
Copy link
Contributor

Backend code coverage report for PR #77207
No changes

@github-actions
Copy link
Contributor

Frontend code coverage report for PR #77207

Plugin Main PR Difference
loki 86.28% 86.3% .02%

Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

Just a nit, rest LGTM!

…ocumentation.md

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
Copy link

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

Looks good, though I noticed a few of the tests don't seem to be testing the new logic. We're either missing the correct assertions or they're not necessary.

@ivanahuckova ivanahuckova merged commit f5d04a0 into main Oct 30, 2023
17 checks passed
@ivanahuckova ivanahuckova deleted the ivana/fetchLabelValues-options branch October 30, 2023 09:16
ssama88 pushed a commit to ssama88/grafana that referenced this pull request Oct 31, 2023
…7207)

* Loki: Add optional stream selector to fetchLabelValues API

* Update public/app/plugins/datasource/loki/docs/app_plugin_developer_documentation.md

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Update tests

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants