openfaas / faas

OpenFaaS - Serverless Functions Made Simple
https://www.openfaas.com
MIT License
25.17k stars 1.94k forks source link

How to modify prometheus rules and other config files and apply those changes? #1515

Closed VivekMBhasi closed 4 years ago

VivekMBhasi commented 4 years ago

My actions before raising this issue

I have currently installed OpenFaaS and have it running on a 3-Node cluster. I wished to tweak the alert.rules.yml file in the prometheus folder to change the threshold at which the alertmanager gets invoked. This attempt failed as I was not allowed to touch the config files to make changes. After seeing a similar issue on another github page, I tried creating a new rule file and a new prometheus.yml file with the exact same contents of the previous config files (namely alert.rules.yml and prometheus.yml) and just changed the value for which the alertmanager gets trigerred in the new rules file that I made. To ensure these files are considered when updating the services, I made changes in the docker-compose.yml file and made sure the 'prometheus_config' and 'prometheus_rules' were set to the new files that I created. After trying to run deploy_stack.sh, it still doesn't let me change the configs. Is that supposed to be like that or am I doing something wrong here?

Expected Behaviour

The various services should've gotten updated after running deploy_stack.sh

Current Behaviour

It keeps showing me this error: failed to update config func_prometheus_config: Error response from daemon: rpc error: code = InvalidArgument desc = only updates to Labels are allowed

Possible Solution

Steps to Reproduce (for bugs)

  1. Try changing alert.rules.yml
  2. run deploy_stack.sh OR
  3. Try making new config files
  4. Update docker-compose.yml with these config files
  5. Run deploy_stack.sh

Context

I wanted to change the threshold at which the alertmanager would get invoked (and possibly try playing around with the config files to see what can be done).

Your Environment

Next steps

You may join Slack for community support.

alexellis commented 4 years ago

You can read the docs for Docker, or join Slack to seek out technical support.

I would also suggest you switch over to Kubernetes which allows you to edit configs dynamically. Just read the OpenFaaS docs on how to deploy, or use the workshop.

alexellis commented 4 years ago

/msg: slack

derek[bot] commented 4 years ago

-- Join Slack to connect with the community https://docs.openfaas.com/community