commit | afbf4d0e931a24b5212532ad791aff3df211fa68 | [log] [tgz] |
---|---|---|
author | Michal Kobus <mkobus@mirantis.com> | Wed Nov 28 14:18:05 2018 +0100 |
committer | Michal Kobus <mkobus@mirantis.com> | Thu Nov 29 15:20:37 2018 +0100 |
tree | 3dd89b62e3ef98b3df8d6e419e38e28aee04ff11 | |
parent | 154a01dbaead449d073c2938c56aec91e82bceb2 [diff] |
Add Prometheus scraping endpoint Available on /metrics endpoint. Added when app is run via uwsgi: uwsgi --http 127.0.0.1:5000 \ --wsgi-file sf_notifier/server.py \ --callable app_dispatch Change-Id: I3aa8f715e81f6032d6c14e1b764324ea05473e45 Related-bug: PROD-25099 (PROD:25099)
Prometheus Alertmanager webhook receiver sending alert notification to Salesforce.
Install Python dependencies:
$ virtualenv venv $ venv/bin/pip install -e . $ source sf_notifier/vars/development
Add to settings/development.py
credentials for your Salesforce customer (not engineering) account:
SF_CONFIG = { 'AUTH_URL': 'xxx', 'USERNAME': 'xxx', 'PASSWORD': 'xxx', 'ORGANIZATION_ID': 'xxx', 'ENVIRONMENT_ID': 'xxx', 'SANDBOX_ENABLED': True }
You may also specify environment variables to override Python settings:
export SFDC_AUTH_URL="xxx" export SFDC_USERNAME="xxx" export SFDC_PASSWORD="xxx" export SFDC_ORGANIZATION_ID="xxx" export SFDC_ENVIRONMENT_ID="xxx" export SFDC_SANDBOX_ENABLED=true
Run server:
$ venv/bin/uwsgi --http 127.0.0.1:5000 --wsgi-file sf_notifier/server.py --callable app_dispatch
Check in browser:
http://127.0.0.1:5000/metrics