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

Add Loki target #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Loki target #657

wants to merge 1 commit into from

Conversation

AndiDog
Copy link

@AndiDog AndiDog commented Apr 23, 2024

What does this do?

Loki targets require the "datasource": {"type": "loki", "uid": "[...]"} field split in order to work in Grafana – as tested in Grafana Cloud which would give me cryptic error messages otherwise.

Why is it a good idea?

Loki is a great way to quickly put together custom dashboards if only (parseable) logs are available for an application, but not metrics. There was no previous example how to use grafanalib for Loki queries.

Questions

I added a basic test. Not sure if I should add an example or more documentation.

Also, I made the LokiTarget a standalone class, not based on Target, since the "base fields" in Target are not desired (e.g. adding the field query or others could lead to errors, I think).

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

Successfully merging this pull request may close these issues.

None yet

1 participant