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

Levels variable: populate values #735

Closed
wants to merge 8 commits into from

Conversation

gtk-grafana
Copy link
Contributor

@gtk-grafana gtk-grafana commented Aug 27, 2024

Populate the values of the levels variable!

image

@gtk-grafana gtk-grafana marked this pull request as ready for review September 11, 2024 13:07
@gtk-grafana gtk-grafana requested a review from a team as a code owner September 11, 2024 13:07
@@ -220,7 +249,6 @@ function getVariableSet(initialDatasourceUid: string, initialFilters?: AdHocVari
applyMode: 'manual',
layout: 'vertical',
getTagKeysProvider: () => Promise.resolve({ replace: true, values: [] }),
getTagValuesProvider: () => Promise.resolve({ replace: true, values: [] }),
Copy link
Contributor

Choose a reason for hiding this comment

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

OHHHHHH. I'm am very certain that it would have been way easier to spot if this wasn't called "tags".

@matyax
Copy link
Contributor

matyax commented Sep 11, 2024

I added a level filter from Logs Volume and I'm not getting values:

imagen

@@ -16,8 +16,8 @@ export const VAR_FIELDS = 'fields';
export const VAR_FIELDS_EXPR = '${fields}';
export const VAR_PATTERNS = 'patterns';
export const VAR_PATTERNS_EXPR = '${patterns}';
export const VAR_LEVELS = 'levels';
Copy link
Contributor

Choose a reason for hiding this comment

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

We support levels plural, what was the reason behind this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because the actual name of the label is level, when calling label/level/values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could revert the change and hardcode the 'level' string in the getTagValuesProvider though

@gtk-grafana
Copy link
Contributor Author

I added a level filter from Logs Volume and I'm not getting values:

I can't seem to repro, does that service have any label values?

@gtk-grafana
Copy link
Contributor Author

I can repro in loki-dev, gdev was throwing me off because it has an indexed label called level, since we can't call the label/.../values endpoint for structured metadata we might be SOL.

I guess we could fallback to parse the logs query, but that's kinda hacky?

@gtk-grafana
Copy link
Contributor Author

Well that sucks, I guess we need a way to get structured metadata values from loki before we can do this. Closing out, I'll add the e2e fix to another branch.

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