-
Notifications
You must be signed in to change notification settings - Fork 3
Available triggers
Lujeni edited this page May 13, 2016
·
12 revisions
-
Same file to configure your triggers:
/path/to/setting.py -
You can easily combine multiple (same) triggers with differents threshold.
-
Common parameters for slow operation check:
-
type(str): the name of type (killer, mongodb, email, webhook...). -
threshold(int): the threshold in second. -
state(bool): True if you want trigger this action when a slow operation is found, False otherwhise. -
params(dict): specific params of the trigger.
-
-
Common parameters for balancer check:
-
type(str): the trigger type (killer, mongodb, email, webhook...). -
state(bool): True if you want trigger this action when a the balancer is enabled, False otherwhise (balancer disabled). -
params(dict): specific params of the trigger.
-
op nok: find slow operation.
op ok: 0 slow operation.
balancer nok: the balancer state is different from the state settings value.
balancer ok: the balancer state is good.
| op nok | op ok | balancer nok | balancer ok | |
|---|---|---|---|---|
| killer | X | |||
| X | X | |||
| mongodb | X | |||
| sentry | X | |||
| webhook | X | X | X | X |
| graphite | X | |||
| mattermost | X | X | X | X |
- Send a signal to mongodb to terminates an operation.
op_triggers:
foo_killer:
type: killer
threshold: 120-
Send a simple HTTP request.
-
parameters:
-
url: The target URL. -
method: The HTTP method.
-
-
optionals parameters:
-
http_params: Passing Parameters In URLs (default: {}) -
requests_params: Kwargs of therequestsmodule. (default: {})
-
op_triggers:
foo_bar_webhook:
type: webhook
state: True
params:
method: get
url: http://requestb.in/17qzafm1
http_params:
fizz: buzz
requests_params:
verify: False
foo_bar_webhook:
type: webhook
state: False # no slow operation found
params:
method: get
url: http://requestb.in/17qzafm1
http_params:
fizz: buzz
foo: bar
requests_params:
verify: False- Insert the slow operation in another database through bulk insert.
- Index is created on the
opidfield. - optionals parameters:
-
database(default: mongoop) -
collection(default: history)
-
op_triggers:
trigger_mongodb_1:
type: mongodb
threshold: 5
state: True
params:
database: mongoop
collection: history- Send a simple email.
- optionals parameters:
-
tls(default: False) -
auth(default: False)
-
op_triggers:
trigger_email_foo:
type: email
threshold: 60
state: True
params:
subject: 'Mongoop report'
from: 'mongoop@localhost'
to: 'root'
smtp_host: 'localhost'
tls: False
auth:
user: coconut
password: 1234- Trigger to allow message to be submitted via Sentry.
- You can customize the message with the field name of a slow operation.
- parameters:
- ``dsn: The sentry addr.
-
message: The culprit message.
- optionals parameters:
-
level(default: info)
-
op_triggers:
foo_bar_sentry:
type: sentry
threshold: 80
state: True
params:
dsn: 'https://898weqe899qweqeq8:wqeqw8888@app.getsentry.com/76885'
message: 'mongoop slow operation :: {opid}'
level: info- Trigger to send metrics throught Graphite/Carbon.
- parameters:
-
metric_per_ns: Add metric per mongodb namespace.
-
- optionals parameters:
-
graphitesend_params: Kwargs of thegraphitesendmodule. (default: {})
-
op_triggers:
foo_bar_graphite:
type: graphite
threshold: 60
state: True
params:
metric_per_ns: True
graphitesend_params:
graphite_server: localhost
prefix: mongoop
system_name: cluster_mongodb_1- Trigger to allow message to be submitted via Sentry.
- You can customize the message with the field name of a slow operation.
- parameters:
- ``dsn: The sentry addr.
-
message: The culprit message.
- optionals parameters:
-
level(default: info)
-
op_triggers:
foo_bar_sentry:
type: sentry
threshold: 80
state: True
params:
dsn: 'https://898weqe899qweqeq8:wqeqw8888@app.getsentry.com/76885'
message: 'mongoop slow operation :: {opid}'
level: info- Trigger to send a notification to a mattermost channel.
- parameters:
-
url: The url of the mattermost server. -
api_key: The key of the mattermost incomig hook. -
channel: The mattermost channel.
-
- optionals parameters:
-
username: The display name. (default: Mongoop) -
icon_url: The display icon. (default: https://plugins.qgis.org/static/cache/c8/13/c813bff978535a743f63161bc3a7f937.png) )
-
op_triggers:
foo_bar_mattermost:
type: mattermost
threshold: 60
state: True
params:
url: https://mattermost.coconut.com
api_key: dkhjyh7701mh6
channel: mongoop
username: Mongoop
icon_url: https://coconut.com/coco.png