commit | a3f8fe47d2fc3c7dc6d3cd2200c9d04ae107a690 | [log] [tgz] |
---|---|---|
author | Michal Kobus <mkobus@mirantis.com> | Mon Jun 27 10:30:18 2022 +0200 |
committer | Michal Kobus <mkobus@mirantis.com> | Thu Jun 30 12:31:01 2022 +0000 |
tree | 95d8dae5552abbf799d508e4f168086d2a95ee0f | |
parent | 5dd8765f461cf65853883218cedb1962e7bf28d3 [diff] |
Add no_retry arg in auth method - make initial authentication without retry to avoid infinite loop blocking __init__() to return and therefore logs from appearing - catch any exception appearing during auth() execution Change-Id: Ibe9d872f3621e1bd37d35732990e0b91eb4589f6 Related-PROD: PRODX-24306
Prometheus Alertmanager webhook receiver sending alert notification to Salesforce.
Install Python dependencies:
$ virtualenv venv -p python3 $ source venv/bin/activate (venv)$ source sf_notifier/vars/development (venv)$ pip install --upgrade pip (venv)$ pip install -e .
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)$ 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