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

Target rules in dashboard linter #59

Closed
mshahzeb opened this issue May 24, 2022 · 2 comments
Closed

Target rules in dashboard linter #59

mshahzeb opened this issue May 24, 2022 · 2 comments

Comments

@mshahzeb
Copy link
Contributor

  • Dont allow unused targets to be present in the dashboard
  • Check for targets with empty expressions
@rgeyer
Copy link
Collaborator

rgeyer commented Jun 2, 2022

  • Check for targets with empty expressions

target-promql-rule already checks this, since an empty expression can not be parsed as promql. We could add this test case to the test suite, just to cover it.

Related, I just found on the awx mixin, which uses a panel reference as it's target, that the linter does not support this case. Explicitly because, the target-promql-rule attempts to parse the expr, but there isn't one.

[target-promql-rule] 'AWX': Dashboard 'AWX', panel 'License Type' invalid PromQL query '': 1:1: parse error: no expression found in input

The linter should permit these type of targets, and should validate that the referenced panel/query exists.

"targets": [
            {
               "panelId": 3,
               "refId": "A"
            }
         ],

@mshahzeb
Copy link
Contributor Author

mshahzeb commented Jul 5, 2022

This is fixed and merged in the PR referenced above^

@rgeyer rgeyer closed this as completed Jul 15, 2022
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

No branches or pull requests

2 participants