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

Recursively search for alert rule files #3954

Closed
arnisoph opened this Issue Mar 13, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@arnisoph
Copy link

arnisoph commented Mar 13, 2018

I tried to specify a directory in the main config, which obviously isn't supported. I don't know the actual list of directories that contain these files but I know the structure (see tree below).

The following doesn't work because prometheus expects file paths only:

rule_files:
  - /etc/prometheus-alerts/

The following doesn't work because golang's file globs doesn't support that:

rule_files:
  - /etc/prometheus-alerts/*/*/*.yaml

Example file tree:

$ tree prometheus-alerts
/etc/prometheus-alerts
|-- team1/
|   `-- configmap1/
|       |-- alert1.yaml
|       `-- alert2.yaml
`-- team2/
    |-- configmap1/
    |   |-- alert1.yaml
    |   |-- alert2.yaml
    |   `-- alert3.yaml
    `-- configmap2/
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 14, 2018

rule_files is a lost of files, not directories. You can use a glob in the filename though (but not the directories).

@arnisoph

This comment has been minimized.

Copy link
Author

arnisoph commented Mar 14, 2018

@brian-brazil in this case I expect to be able to to specific something like:

rule_files:
  - /etc/prometheus-alerts/*/*/*.yaml

But golang's file globs doesn't support that. That's my issue, I don't know the actual list of directories that contain these files.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 14, 2018

It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@arnisoph

This comment has been minimized.

Copy link
Author

arnisoph commented Mar 14, 2018

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.