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

LogQL: Pattern Parser #3837

Merged
merged 28 commits into from
Jun 15, 2021
Merged

LogQL: Pattern Parser #3837

merged 28 commits into from
Jun 15, 2021

Conversation

cyriltovena
Copy link
Contributor

@cyriltovena cyriltovena commented Jun 10, 2021

What this PR does / why we need it:

This PR adds a new parser that is easier to use than the regexp one. See design docs https://docs.google.com/document/d/135OltV_nJgLgryzRhEn5ULgcbwl5bDB6i79IOzMp8IQ/edit

In term of performance it seems to be the fastest parser right now.

Special notes for your reviewer:
See tests for example of usages.

Checklist

  • Documentation added
  • Tests updated

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, left a few grammatical nits.
Didn't spot a test here for a duplicate matcher (i.e. <user> <user>) - did I miss it?

docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
pkg/logql/log/pattern/ast.go Show resolved Hide resolved
pkg/logql/log/pattern/pattern_test.go Show resolved Hide resolved
@cyriltovena
Copy link
Contributor Author

LGTM, left a few grammatical nits.
Didn't spot a test here for a duplicate matcher (i.e. <user> <user>) - did I miss it?

Good point @dannykopping I think we need that check !

@cyriltovena
Copy link
Contributor Author

LGTM, left a few grammatical nits.
Didn't spot a test here for a duplicate matcher (i.e. <user> <user>) - did I miss it?

Good point @dannykopping I think we need that check !

Ho in fact it's there already https://github.com/cyriltovena/loki/blob/token/pkg/logql/log/pattern/ast.go#L38

Signed-off-by: Cyril Tovena <[email protected]>
@dannykopping
Copy link
Contributor

LGTM, left a few grammatical nits.
Didn't spot a test here for a duplicate matcher (i.e. <user> <user>) - did I miss it?

Good point @dannykopping I think we need that check !

Ho in fact it's there already https://github.com/cyriltovena/loki/blob/token/pkg/logql/log/pattern/ast.go#L38

It's checking for it, but is there a test that explicitly exercises that?

@cyriltovena
Copy link
Contributor Author

LGTM, left a few grammatical nits.
Didn't spot a test here for a duplicate matcher (i.e. <user> <user>) - did I miss it?

Good point @dannykopping I think we need that check !

Ho in fact it's there already https://github.com/cyriltovena/loki/blob/token/pkg/logql/log/pattern/ast.go#L38

It's checking for it, but is there a test that explicitly exercises that?

https://github.com/cyriltovena/loki/blob/token/pkg/logql/log/pattern/pattern_test.go#L155

Copy link
Contributor

@KMiller-Grafana KMiller-Grafana left a comment

Choose a reason for hiding this comment

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

I've made suggestions on the documentation portion of this PR. The documentation will be good to go with suggested changes. What a nice parsing addition!

docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
docs/sources/logql/_index.md Outdated Show resolved Hide resolved
@cyriltovena cyriltovena merged commit 59bb6d3 into grafana:main Jun 15, 2021
@rbudiharso
Copy link

Hi, I'm sorry but is this parser already released?, the documentation on LogQL already have this mentioned and I have Loki version 2.2.1 (the latest one, AFAIK) but I can't use this parser yet

@dannykopping
Copy link
Contributor

Hi @rbudiharso - the feature is not yet released; it'll be included in the upcoming v2.3 release.

The feature is available for use if you build from main, although we don't always guarantee stability on main.

Apologies for the confusion!

@gerardtoconnor
Copy link

Hi @dannykopping, do we have an approximate release date for v2.3? I presume/hope will be deployed to Grafana Cloud shortly thereafter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants