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

clarify logcli commands and output #1712

Merged
merged 6 commits into from
Mar 30, 2020

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Feb 18, 2020

This PR attempts to do two things:

  1. Differentiate between log entries and raw log lines, where the latter is what is produced by -oraw.
  2. Explain the difference between logcli query and logcli instant-query.

Fixes #1676.

/cc @Dieterbe PTAL and let me know if this would've been helpful for you earlier on 🙂

cmd/logcli/main.go Outdated Show resolved Hide resolved
cmd/logcli/main.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

A few nits otherwise LGTM

@rfratto
Copy link
Member Author

rfratto commented Feb 18, 2020

Thanks for the review @slim-bean! I'd like to wait for @Dieterbe to give this a look before I merge so we get a non-Loki dev's opinion on it.

cmd/logcli/main.go Outdated Show resolved Hide resolved
cmd/logcli/main.go Outdated Show resolved Hide resolved
the performed query and its results. Raw log lines (i.e., without a
label and timestamp) can be retrieved by passing the "-o raw" flag.
The extra information about the query (API URL, set of common labels,
excluded labels) can be suppressed with the --query flag.
Copy link
Contributor

Choose a reason for hiding this comment

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

"log line" vs "raw log line" is ambiguous. are they the same thing?

can you structure this information more? that would make this clearer I think
maybe something like:

  • log line: contains what exactly? only the output lines from the app?
  • log entry: timestamp + labels + log line

query output:

  • default: log entries + query metadata + result metadata
  • -o raw to show log lines rather than log entries
  • --query (you probably meant --quiet here!) to surpress query metadata and result metadata

Copy link
Contributor

@Dieterbe Dieterbe left a comment

Choose a reason for hiding this comment

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

see comments

@rfratto
Copy link
Member Author

rfratto commented Mar 5, 2020

Sorry for the delay @Dieterbe, PTAL at the changes. I didn't sync logcli.md with the flag changes yet, but I'll do that once you think the changes look good.

@Dieterbe
Copy link
Contributor

looks good robert!

@codecov-io
Copy link

Codecov Report

Merging #1712 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1712      +/-   ##
==========================================
+ Coverage   64.07%   64.09%   +0.02%     
==========================================
  Files         121      121              
  Lines        9027     9027              
==========================================
+ Hits         5784     5786       +2     
+ Misses       2841     2840       -1     
+ Partials      402      401       -1     
Impacted Files Coverage Δ
pkg/ingester/transfer.go 66.42% <0.00%> (+1.42%) ⬆️

This commit attempts to do two things:

1. Differentiate between log entries and raw log lines, where the latter
   is what is produced by `-oraw`.
2. Explain the difference between `logcli query` and
   `logcli instant-query`.

Fixes grafana#1676.
This commit leaves logcli.md unmodified; that will be done in a later
commit if the changes are approved.
@rfratto
Copy link
Member Author

rfratto commented Mar 30, 2020

@Dieterbe I've synced logcli.md with the go file. Can you approve this so we can merge it?

@rfratto rfratto merged commit 8948ce1 into grafana:master Mar 30, 2020
@rfratto rfratto deleted the logcli-clarification branch March 30, 2020 14:52
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.

logcli --quiet flag misleading
5 participants