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

Allow no loki client configuration in Promtail #6992

Open
yeya24 opened this issue Aug 27, 2022 · 4 comments
Open

Allow no loki client configuration in Promtail #6992

yeya24 opened this issue Aug 27, 2022 · 4 comments

Comments

@yeya24
Copy link
Contributor

yeya24 commented Aug 27, 2022

Is your feature request related to a problem? Please describe.
My use case for promtail is not sending logs to Loki. I use promtail to only generate metrics from logs.
In my scenario, there is no need to send logs to Loki. But Promtail itself doesn't allow no Loki client configuration specified.

Describe the solution you'd like
Allow promtail to configure no Loki client.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@chaudum
Copy link
Contributor

chaudum commented Aug 29, 2022

@yeya24 You can use the --dry-run CLI argument to not send any logs. However, you still need at least one client config. You can use the simplest possible configuration for that:

clients:
- url: http://localhost:3100/loki/api/v1/push

Would that help?

@yeya24
Copy link
Contributor Author

yeya24 commented Aug 29, 2022

This will send logs to a non exist destination, right?
Although it works, this is still unnecessary. Is it difficult to support no clients?

@chaudum
Copy link
Contributor

chaudum commented Aug 30, 2022

This will send logs to a non exist destination, right?

No, when using --dry-run, no logs are sent.

I don't really like the idea of allowing no clients, because for almost all use cases you want to send logs, and therefore it should raise an error when there is no client configured.
Allowing an empty list of clients will lead to confusion when Promtail is misconfigured.

@nerrehmit
Copy link
Contributor

I'd like to chime in. We currently have the same requirement as the original poster. We are only interested in generating metrics from logs without the involvment of a loki server.
While using --dry-run is an option this still has some drawbacks.
Firstly using --dry-run promtail does not update the positions.yaml meaning that after a restart all the logfiles are read again, parsing them again and generating the metrics again.
Secondly, and this might be unique to our setup, the windows service wrapper used to run promtail as a service under windows logs all the stdout to it's own log file.
With promtail running in --dry-run mode and thus logging all loglines to stdout this effectively doubles the size of the log.

So a dedicated option to run promtail without any log shipping would be a very welcomed functionality.

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

No branches or pull requests

3 participants