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

Add LogQL support for Loki v3.1.0 #723

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

periklis
Copy link
Contributor

@periklis periklis commented Jul 5, 2024

Add support for LogQL features included in Loki between 2.9.8 and v3.1.0. Diff:

6df81db97 feat: Support negative numbers in LogQL (#13091)
4c88be0ef chore: update loki modules for 3.0 release (#12433)
36c703dae feat: add pattern match line filter (#12398)
cc941fe42 chore: refactor line filter MatchType (#12388)
60edfe000 Implement "or" statement in line filters (#8962)
6bced8345 [release-2.9.x] Revert "LogQL: Introduce `distinct` (#8662)" (#10358)
c030217e1 Revert "LogQL: Introduce `distinct` (#8662)" (#10356)

LogQL features implemented in our log api's parser:

Refs: LOG-5761

/cc @JoaoBraveCoding @jotak

@periklis periklis requested a review from xperimental July 5, 2024 18:56
@periklis periklis self-assigned this Jul 5, 2024
Copy link
Contributor

@JoaoBraveCoding JoaoBraveCoding left a comment

Choose a reason for hiding this comment

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

Tested:

  • negative numbers ✅
  • "or" statement in line filters ✅
  • patter match line filter 🚧

When testing I was able to get results with the following expression:

{ log_type="application" } !> "I <_>"| json

But using the inverse:

{ log_type="application" } |> "I <_>"| json

I would get: Parse error at line 1, col 30: syntax error: unexpected STRING

@periklis
Copy link
Contributor Author

@JoaoBraveCoding The issue described with pattern line filters is truly on applicable with OCP's Log Console. Pending fixes for the console:

Meanwhile limit testing to logcli please such as:

export LOKI_PUBLIC_URL=$(k -n openshift-logging get route lokistack-dev -o jsonpath="{.spec.host}")

logcli --tls-skip-verify --bearer-token="$(oc whoami -t)" --addr "https://${LOKI_PUBLIC_URL}/api/logs/v1/application" query '{ log_type="application" }  |> "I <_>"| json'

@periklis periklis merged commit 02d067e into observatorium:main Jul 11, 2024
5 checks passed
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