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

Include positions filename in the error when YAML unmarshal fails. #1311

Merged
merged 2 commits into from
Nov 26, 2019
Merged

Include positions filename in the error when YAML unmarshal fails. #1311

merged 2 commits into from
Nov 26, 2019

Conversation

pstibrany
Copy link
Member

When reading of positions file failed previously, error message looked like this:

level=error ts=2019-11-25T07:53:35.626673Z caller=main.go:61 msg="error creating promtail" error="yaml: line 3: found unexpected end of stream"

Without further context, it's not clear that the problem is in positions file, and one may incorrectly assume that it's the config file that is wrong. This PR changes error message to include the filename:

level=error ts=2019-11-25T08:30:07.944456Z caller=main.go:61 msg="error creating promtail" error="/tmp/1187-positions.yml: yaml: line 3: found unexpected end of stream"

This PR also changes error message when loading of config file fails from...

Unable to parse config: sourcing: yaml: line 54: found unexpected end of stream

to

Unable to parse config: 1187-promtail.yaml: yaml: line 54: found unexpected end of stream

@rfratto rfratto requested a review from sh0rez November 25, 2019 21:44
Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@cyriltovena cyriltovena merged commit 9956717 into grafana:master Nov 26, 2019
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.

3 participants