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

feat(queryExpressions): add buildBaseQueryExpression to create the base LogQL expression #311

Closed
wants to merge 5 commits into from

Conversation

svennergr
Copy link
Contributor

@svennergr svennergr commented May 7, 2024

buildBaseQueryExpression will create the basic LogQL expression instead of relying on AdhocFilters to do the trick. This allows to more easily adapt expressions where needed.

The PR also renames the VAR_FILTERS to VAR_LABELS to make it clear that that variable stores all indexed labels.

Additional side effect: this fixes the "Go to Explore" button, that did not include | logfmt in some cases.

Fixes #257

@svennergr svennergr requested a review from a team May 7, 2024 19:13
@svennergr svennergr requested review from gtk-grafana and a team May 13, 2024 16:45
return `sum by (${field}) (count_over_time(${LOG_STREAM_SELECTOR_EXPR} | drop __error__ | ${field}!="" [$__auto]))`;
return `sum by (${field}) (count_over_time(${buildBaseQueryExpression(
sceneObject
)} | drop __error__ | ${field}!="" [$__auto]))`;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need excess whitespace anymore?

@gtk-grafana
Copy link
Contributor

Summarizing our slack thread:
Seeing a host of bugs with queries not being updated when variables they depend on have changed, for example the logs volume histogram not updating when the text query is updated, etc.

Sven mentioned we might be able to fix this with _variableDependency on the scene classes.

@svennergr svennergr self-assigned this May 15, 2024
@svennergr
Copy link
Contributor Author

Summarizing our slack thread: Seeing a host of bugs with queries not being updated when variables they depend on have changed, for example the logs volume histogram not updating when the text query is updated, etc.

Sven mentioned we might be able to fix this with _variableDependency on the scene classes.

thanks galen. I'll continue to look into that.

@svennergr svennergr marked this pull request as draft May 15, 2024 13:13
@svennergr svennergr force-pushed the svennergr/query-expressions branch from ead7e4d to 87ffc87 Compare June 24, 2024 12:26
@svennergr svennergr closed this Jul 8, 2024
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.

[queries] Query expression creation in the app rather than adhoc filters
2 participants