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

Print the filename that failed validation #5

Closed
sed-i opened this issue Jan 27, 2023 · 0 comments · Fixed by #8
Closed

Print the filename that failed validation #5

sed-i opened this issue Jan 27, 2023 · 0 comments · Fixed by #8

Comments

@sed-i
Copy link
Contributor

sed-i commented Jan 27, 2023

Enhancement Proposal

It would be handy if cos-tool printed the filename of the file that failed validation when used e.g. like so:

find . -path '*/prometheus_alert_rules/*' -type f -exec ./cos-tool-amd64 --format promql lint {} +

Currently, the output from cos-tool looks like this:

error validating: yaml: unmarshal errors:
  line 1: field alert not found in type rulefmt.RuleGroups
  line 2: field expr not found in type rulefmt.RuleGroups
  line 3: field for not found in type rulefmt.RuleGroups
  line 4: field labels not found in type rulefmt.RuleGroups
  line 6: field annotations not found in type rulefmt.RuleGroups
failed

so it's impossible to know which file failed validation.

Related: canonical/observability#22

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 a pull request may close this issue.

1 participant