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

Support series API in logcli #1861

Merged
merged 2 commits into from
Mar 31, 2020
Merged

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Mar 28, 2020

Signed-off-by: yeya24 [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #1841

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

@yeya24 yeya24 force-pushed the support-series branch 2 times, most recently from 43fb03e to 6f798fb Compare March 29, 2020 00:17
@codecov-io
Copy link

Codecov Report

Merging #1861 into master will increase coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1861      +/-   ##
==========================================
+ Coverage   64.84%   64.89%   +0.05%     
==========================================
  Files         125      125              
  Lines        9423     9426       +3     
==========================================
+ Hits         6110     6117       +7     
+ Misses       2886     2885       -1     
+ Partials      427      424       -3     
Impacted Files Coverage Δ
pkg/ingester/flush.go 84.41% <ø> (ø)
pkg/loghttp/params.go 92.50% <ø> (ø)
pkg/util/query_string_builder.go 76.00% <0.00%> (-10.37%) ⬇️
pkg/promtail/targets/filetarget.go 70.55% <0.00%> (+1.84%) ⬆️
pkg/promtail/targets/tailer.go 78.40% <0.00%> (+4.54%) ⬆️

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

@yeya24 Thank you so much !! It look awesome. And thanks for fixing many typos and formatting issue you deserve a medal 🏅

LGTM

@cyriltovena
Copy link
Contributor

If you have some time to rebase and fix the conflict, I'll get that merged asap.

Signed-off-by: yeya24 <[email protected]>

add changelog

Signed-off-by: yeya24 <[email protected]>
@yeya24
Copy link
Contributor Author

yeya24 commented Mar 31, 2020

Hi @cyriltovena @owen-d I have rebased my code. PTAL

cmd.Flag("since", "Lookback window.").Default("1h").DurationVar(&since)
cmd.Flag("from", "Start looking for logs at this absolute time (inclusive)").StringVar(&from)
cmd.Flag("to", "Stop looking for logs at this absolute time (exclusive)").StringVar(&to)
cmd.Flag("match", "eg '{foo=\"bar\",baz=~\".*blip\"}'").Required().StringsVar(&q.Matchers)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you show me an example of how it work with multiple matches ? what's the cli look like for them ? is it space based or comma seperated ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm asking cause I see that StringsVar is an array.

Copy link
Member

@owen-d owen-d Mar 31, 2020

Choose a reason for hiding this comment

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

I'd also like to know that, but otherwise LGTM!

Nice work @yeya24. Would you mind updating https://github.com/grafana/loki/blob/master/docs/getting-started/logcli.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
This works just the same like promtool query series

Copy link
Member

Choose a reason for hiding this comment

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

Great. I won't hold up the PR if you don't want to add the docs, but I'd appreciate it :). Let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add it this afternoon. Will ping you when I finish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, I have updated the docs. PTAL @owen-d

Signed-off-by: yeya24 <[email protected]>
@cyriltovena cyriltovena merged commit 9a62deb into grafana:master Mar 31, 2020
@yeya24 yeya24 deleted the support-series branch March 31, 2020 19:39
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.

Support series API in logcli
4 participants