$ tree prometheus-alerts
/etc/prometheus-alerts
|-- team1/
| `-- configmap1/
| |-- alert1.yaml
| `-- alert2.yaml
`-- team2/
|-- configmap1/
| |-- alert1.yaml
| |-- alert2.yaml
| `-- alert3.yaml
`-- configmap2/Hi,I have a complex directory structure (built by https://github.com/inovex/trovilo) container alert files that is automatically (re-)generated. Prometheus accepts actual file paths (golang file globs) on "rule_files" in the configuration only.I think that might be a feature request worth since I don't see how to do this now. See also https://github.com/prometheus/prometheus/issues/3954 (closed).Any ideas?
$ tree prometheus-alerts /etc/prometheus-alerts |-- team1/ | `-- configmap1/ | |-- alert1.yaml | `-- alert2.yaml `-- team2/ |-- configmap1/ | |-- alert1.yaml | |-- alert2.yaml | `-- alert3.yaml `-- configmap2/Arnold
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/89a45b88-62b2-4755-86fe-5efc1be48fed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 14 March 2018 at 09:46, arnold.bechtoldt via Prometheus Users <promethe...@googlegroups.com> wrote:Hi,I have a complex directory structure (built by https://github.com/inovex/trovilo) container alert files that is automatically (re-)generated. Prometheus accepts actual file paths (golang file globs) on "rule_files" in the configuration only.I think that might be a feature request worth since I don't see how to do this now. See also https://github.com/prometheus/prometheus/issues/3954 (closed).Any ideas?You should either arrange your files into a known set of directories, or have your configuration management generate the list of all files/directories when templating out your prometheus.yml.Brian
$ tree prometheus-alerts /etc/prometheus-alerts |-- team1/ | `-- configmap1/ | |-- alert1.yaml | `-- alert2.yaml `-- team2/ |-- configmap1/ | |-- alert1.yaml | |-- alert2.yaml | `-- alert3.yaml `-- configmap2/Arnold
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/89a45b88-62b2-4755-86fe-5efc1be48fed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,
do you know why my last answer was deleted? Did I miss any rules?
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/a289424f-035c-46ef-8f57-9270f68e79ab%40googlegroups.com.
Hello,according to the prometheus source code the filepath.Glob() function is used. (See https://github.com/prometheus/prometheus/blob/master/cmd/prometheus/main.go#L326-L339) This functions should support that structure. IMHO the regex https://github.com/prometheus/prometheus/blob/master/config/config.go#L33 is too restrictive.
I constructed a small test.
content test.go:package mainimport ("path/filepath""fmt")func main() {files, err := filepath.Glob("./*/*/*.yaml")if err != nil {fmt.Println(err)}for _, file := range files {fmt.Println("Found file: ", file)}}
TestScript:$ mkdir -p team1/configmap1 team2/configmap2
$ touch team1/configmap1/config.yaml
$ touch team2/configmap2/config.yaml
$ go run test.goFound file: team1/configmap1/config.yamlFound file: team2/configmap2/config.yaml
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e9ba08eb-7fc9-4651-abc3-5434db274682%40googlegroups.com.