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

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Add Loki target #657

merged 2 commits into from
Jul 16, 2024

Conversation

AndiDog
Copy link
Contributor

@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).

Copy link
Collaborator

@JamesGibo JamesGibo left a comment

Choose a reason for hiding this comment

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

Thanks for adding this, I will merge this PR, but if you do find time to update the docs to say it supports Loki and provide an example, I think that would be really helpful.

@JamesGibo JamesGibo merged commit eedff24 into weaveworks:main Jul 16, 2024
5 checks passed
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.

2 participants