Skip to content

Commit 947d401

Browse files
committed
Add config file details for alert configurations
1 parent 901a00e commit 947d401

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"enabled": true,
3+
"eventTypeName": "NO_PRIMARY",
4+
"matchers": [
5+
{
6+
"fieldName": "REPLICA_SET_NAME",
7+
"operator": "EQUALS",
8+
"value": "event-replica-set"
9+
}
10+
],
11+
"notifications": [
12+
{
13+
"datadogApiKey": "****************************a23c",
14+
"datadogRegion": "US",
15+
"delayMin": 0,
16+
"intervalMin": 5,
17+
"notifierId": "6462742adc47d365036da07c",
18+
"typeName": "DATADOG"
19+
}
20+
],
21+
"threshold": {
22+
"operator": "<",
23+
"threshold": 0,
24+
"units": "bits"
25+
}
26+
}

source/reference/json.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ you can pass a configuration file when using the {+atlas-cli+} to:
2020
- :ref:`Create <atlas-clusters-search-indexes-create>` or
2121
:ref:`update an Atlas Search Index <atlas-clusters-search-indexes-update>`.
2222
- :ref:`Create a {+df+} database <atlas-dataFederation-create>`.
23+
- :ref:`Create <atlas-alerts-settings-create>` or
24+
:ref:`update an alert configuration <atlas-alerts-settings-update>`.
2325

2426
Usage
2527
-----
@@ -57,6 +59,12 @@ command. The commands you can use include but are not limited to:
5759
* - :ref:`atlas-dataFederation-create`
5860
- :oas-atlas-op:`Create One Federated Database Instance in One Project </createFederatedDatabase>`
5961

62+
* - :ref:`atlas-alerts-settings-create`
63+
- :oas-atlas-op:`Create One Alert Configuration in One Project </createAlertConfiguration>`
64+
65+
* - :ref:`atlas-alerts-settings-update`
66+
- :oas-atlas-op:`Update One Alert Configuration for One Project </updateAlertConfiguration>`
67+
6068
When you run the command in your terminal, specify the ``--file`` option
6169
and provide the path to the |json| configuration file that defines your
6270
desired settings.
@@ -120,10 +128,18 @@ To learn more about {+adf+} configuration files, see
120128
:ref:`atlas-cli-data-federation-config-file`. For a sample file,
121129
see :ref:`example-fdi-config-file`.
122130

131+
Alert Configuration File
132+
------------------------
133+
134+
To learn more about alert configuration files, see
135+
:ref:`atlas-cli-alert-config-file`. For a sample file,
136+
see :ref:`example-alert-config-file`.
137+
123138
.. toctree::
124139
:titlesonly:
125140

126141
/reference/json/cluster-config-file
127142
/reference/json/cloud-backup-schedule-config-file
128143
/reference/json/data-federation-config-file
129144
/reference/json/search-index-config-file
145+
/reference/json/alert-config-file
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.. _atlas-cli-alert-config-file:
2+
3+
========================
4+
Alert Configuration File
5+
========================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
You can use a configuration file to specify the
14+
settings for :ref:`creating <atlas-alerts-settings-create>`
15+
or :ref:`updating <atlas-alerts-settings-update>` an alert
16+
configuration through the {+atlas-cli+}. The {+atlas-cli+}
17+
accepts ``.json`` configuration files.
18+
19+
.. _alert-config-settings:
20+
21+
Alert Configuration Settings
22+
----------------------------
23+
24+
Depending on the type of alert configuration, you can specify the
25+
following settings to create or update an alert configuration
26+
in a configuration file:
27+
28+
.. list-table::
29+
:widths: 20 10 70
30+
:header-rows: 1
31+
32+
* - Field
33+
- Type
34+
- Description
35+
36+
* - ``enabled``
37+
- boolean
38+
- Flag that indicates whether someone enabled this
39+
alert configuration for the specified project.
40+
41+
* - ``eventTypeName``
42+
- string
43+
- Required. Event type that triggers an alert.
44+
45+
* - ``matchers``
46+
- array of objects
47+
- Rules to apply when matching an object against this alert
48+
configuration. You can use this field only if the ``eventTypeName``
49+
specifies an event for a host, replica set, or sharded cluster.
50+
51+
* - ``metricThreshold``
52+
- object
53+
- Threshold for the metric that, when exceeded, triggers an alert.
54+
You can use this field only if the ``eventTypeName`` reflects
55+
a change in measurement or metric.
56+
57+
* - ``notifications``
58+
- array of objects
59+
- List that contains the targets that |service| sends notifications.
60+
61+
* - ``threshold``
62+
- object
63+
- A limit that triggers an alert when exceeded.
64+
65+
For detailed descriptions and a full list of available settings,
66+
see the request body schema in the API specification:
67+
68+
- :oas-atlas-op:`Create One Alert Configuration in One Project </createAlertConfiguration>`
69+
- :oas-atlas-op:`Update One Alert Configuration for One Project </updateAlertConfiguration>`
70+
71+
.. _example-alert-config-file:
72+
73+
Example Alert Configuration File
74+
--------------------------------
75+
76+
To create or update an alert configuration, specify the
77+
fields that you want to include in the configuration file.
78+
For example, the following sample file enables an alert
79+
configuration that notifies you when a replica set called
80+
``event-replica-set`` loses its primary node:
81+
82+
.. literalinclude:: /includes/alert-configuration-config-file.json

0 commit comments

Comments
 (0)