-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
promtail: panic when fetching target Details #6930
Comments
Can confirm similar behavior while testing the grafana agent promtail targets endpoint: Doesn't look like scraping is affected in any way, until the endpoint is probed that is. |
I can try to tackle this if that's okay with you. |
5 tasks
Sorry for being extra late on this, my bad. |
chaudum
pushed a commit
that referenced
this issue
Nov 30, 2022
Abuelodelanada
pushed a commit
to canonical/loki
that referenced
this issue
Dec 1, 2022
**What this PR does / why we need it**: This PR addresses issue [grafana#6930](grafana#6930). Promtail should not panic when the Details() method is called for a target that has no errors. **Which issue(s) this PR fixes**: Fixes grafana#6930
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Calling the Details() method of a target that has a nil error results in a panic.
loki/clients/pkg/promtail/targets/docker/target.go
Lines 252 to 256 in 2911a74
To Reproduce
We witnessed this behavior in the Agent code, when trying to list the status of Logs targets fetched from the Docker SD mechanism, but the same seems to be true for most implementations of the Details() method. As far as I can tell with a quick search, the method is only used in Loki for logging which might be why it hasn't been reported before.
Steps to reproduce the behavior:
Call the Details() method on a target that hasn't errored out.
Expected behavior
The Details() method should return an empty string or a nil value.
Environment:
Any.
Screenshots, Promtail config, or terminal output
For completeness' sake, here's the job definition used under Promtail's scrape_configs.
The text was updated successfully, but these errors were encountered: