observatorium / api

The Observatorium API
Apache License 2.0
53 stars 65 forks source link

Add LogQL support for Loki v3.1.0 #723

Closed periklis closed 2 months ago

periklis commented 2 months ago

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 commented 2 months ago

@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'