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

Does Loki docker driver respect max-file and max-size from json-driver? #3046

Closed
vitalets opened this issue Dec 7, 2020 · 3 comments · Fixed by #3049
Closed

Does Loki docker driver respect max-file and max-size from json-driver? #3046

vitalets opened this issue Dec 7, 2020 · 3 comments · Fixed by #3049
Labels
good first issue These are great first issues. If you are looking for a place to start, start here!

Comments

@vitalets
Copy link
Contributor

vitalets commented Dec 7, 2020

I have a docker daemon with the default json logging config:

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Then I run a container that sends logs to Loki :

docker run --log-driver=loki --log-opt loki-url="..." my-container

I don't specify max-file and max-size options.
What will be actual values of max-file and max-size?
Will Loki use it's defaults (max-file=1, max-size=-1 per docs) or it will borrow these options from json log driver?

It would be great to clarify in docs.
Thanks!

@cyriltovena
Copy link
Contributor

It will use the default.

@cyriltovena cyriltovena added beginner-friendly good first issue These are great first issues. If you are looking for a place to start, start here! labels Dec 7, 2020
@vitalets
Copy link
Contributor Author

vitalets commented Dec 7, 2020

Thanks, @cyriltovena !

How about such addition in docs?

Note: The Loki logging driver still uses the json-log driver in combination with sending logs to Loki, this is mainly useful to keep the docker logs command working.
You can adjust file size and rotation using the respective log option max-size and max-file. Keep in mind that default values for these options are not taken from json-log configuration.
You can deactivate this behavior by setting the log option no-file to true.

@cyriltovena
Copy link
Contributor

Sounds good !

vitalets added a commit to vitalets/loki that referenced this issue Dec 7, 2020
Clarify docker-driver configuration about `max-file` and `max-size` default values.
Fixes grafana#3046
cyriltovena pushed a commit that referenced this issue Dec 7, 2020
Clarify docker-driver configuration about `max-file` and `max-size` default values.
Fixes #3046
cyriltovena pushed a commit to cyriltovena/loki that referenced this issue Jun 11, 2021
Previously it would record a `Memcached.Get` operation with a nested
`Memcached.GetMulti`; since they are in one-to-one correspondance this is
pointless.

Skip the outer data collection for the non-batched case, and rename the
batched one to `Memcached.GetBatched` which is more descriptive.

These names are used for metric labels and for tracing span names.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue These are great first issues. If you are looking for a place to start, start here!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants