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

Anyone using katip with "loki"? #136

Open
bitc opened this issue Feb 17, 2022 · 1 comment
Open

Anyone using katip with "loki"? #136

bitc opened this issue Feb 17, 2022 · 1 comment

Comments

@bitc
Copy link
Contributor

bitc commented Feb 17, 2022

Hello, is anyone using katip with the loki log storage system?

loki supports searching through JSON logs: https://grafana.com/docs/loki/latest/logql/log_queries/#json

So I think it should work well, I am just curious if there is anything special that needs to be done, or if anyone has any tips.

Thank you

@MichaelXavier
Copy link
Collaborator

I haven't but it looks like promtail is their agent for ingesting logs and sending them to loki. So if promtail understands line-delimited JSON logs, you might just be able to use mkHandleScribeWithFormatter with jsonFormat to format the lines. You could write that to a file and then have promtail ingest it. I'm not sure if it's necessary but you could use logrotate to keep that log file from getting too big.

It also looks like loki has a push api. So you could potentially skip writing files and write a scribe (katip's term for a log exporter) that writes to that API. For that you could use katip-logzio, katip-datadog or katip-elasticsearch as examples. If you end up going that route, consider publishing it to hackage for other loki users.

Hope that helps!

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

No branches or pull requests

2 participants