Making possible to add rules via docker secret#57
Making possible to add rules via docker secret#57albertogviana wants to merge 15 commits intodocker-flow:masterfrom
Conversation
|
Sorry for not reviewing this earlier... The PR looks great. I'd appreciate if you could extend the docs with this new feature. Also, can you write a sentence or two for the release notes? |
|
Yes, I can do that. |
thomasjpfan
left a comment
There was a problem hiding this comment.
Overall, this PR looks good.
What was the motivation of using docker secrets rather than docker config?
| logPrintf("Writing to alert.rules") | ||
| afero.WriteFile(FS, alertRulesPath, []byte(GetAlertConfig(alerts)), 0644) | ||
| c.RuleFiles = []string{"alert.rules"} | ||
| // c.RuleFiles = []string{"alert.rules"} |
There was a problem hiding this comment.
This commented line can be removed.
| c.InsertScrapesFromDir(configsDir) | ||
| } | ||
|
|
||
| c.RuleFiles = []string{"/run/secrets/*.rules"} |
There was a problem hiding this comment.
How do you feel about using: https://godoc.org/github.com/spf13/afero#Glob to explicitly scan for all the rules, adding these rules to prometheus.yml and logging the rules here?
There was a problem hiding this comment.
Hi @thomasjpfan,
I am using secrets because since the beginning I am injecting the scrapes via secret, so this was my first approach.
I believe I don't need to use https://godoc.org/github.com/spf13/afero#Glob because Prometheus already implemented it.
Yes @vfarcic , I can provide some documentation and release notes.
There was a problem hiding this comment.
@albertogviana Yes. Please add the docs and release notes.
@thomasjpfan Do you think we can merge this after the docs and RNs are done by @albertogviana ?
Update Prometheus to a newer version in the dockerfile: from v2.2.0 to v2.3.2
Update prometheus to a newer version in the dockerfile
fix issue 65 by accepting a list of LISTENER_ADDRESS separated by comma
|
Sorry for not responding earlier... I was traveling for two weeks and could not find time to go through this PR. I'll do my best to go through it sometime next week. As a side note @dorsany, this project is looking for adoption. How about I make you a contributor? |
I am using DFM to monitoring my docker swarm cluster, and I am also using it to monitoring machines that are outside docker swarm. I know it is possible to create scrapes files, although rules files were not possible. I did some changes, and now it is possible to create rules files as docker secrets, the filename needs to have
.rulesas a suffix.Below you will find an example:
Creating a new rule file:
Adding it to docker-flow-monitor.yml file:
I don't know if you want to have this feature, but considering that I did the change, I would like to share it. If this change is ok for you, I can also update the documentation.