alerty-plugin-datadog_event 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +1 -3
- data/example.yml +0 -1
- data/lib/alerty/plugin/datadog_event.rb +2 -3
- data/lib/alerty/plugin/datadog_event/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad239a4fcc28f7b0542a5eee49aeb4738e6beb7
|
4
|
+
data.tar.gz: cb0f5b59f6232a17bc637897d4f591db3e6ac152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d67bed5f978a2cdd6f608da0d2b9b4dc8d94723e7093034f7702e3ad490ee6129344363ccc76468720c3c317987f68cd1c24300915f47e0037048f0462f7675
|
7
|
+
data.tar.gz: 72549994b4dd4706fda2b3ddc2b955566334dda9ac57e8573cf95f81883141f9145e5b978affed92a974cd3cfa221d147a83e3603c86b2cb3b55f1347342300f
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -26,7 +26,6 @@ following is required.
|
|
26
26
|
- **api_key** : Datadog API Key
|
27
27
|
- **subject** : subject of alert. ${command} is replaced with a given command, ${hostname} is replaced with the hostname ran a command
|
28
28
|
- **alert_type** : "error", "warning", "info" or "success". See [Datadog API Document](http://docs.datadoghq.com/ja/api/#events).
|
29
|
-
- **source_type_name** : The type of event being posted. See [Datadog API Document](http://docs.datadoghq.com/ja/api/#events).
|
30
29
|
|
31
30
|
following is an example.
|
32
31
|
|
@@ -39,8 +38,7 @@ plugins:
|
|
39
38
|
- type: datadog_event
|
40
39
|
api_key: API Key
|
41
40
|
subject: "FAILURE [${hostname}] : ${command}"
|
42
|
-
|
43
|
-
subject: "FAILURE [${hostname}] : ${command}"
|
41
|
+
alert_type: error
|
44
42
|
```
|
45
43
|
|
46
44
|
See [examle.yml](https://github.com/inokappa/alerty-plugin-datadog_event/blob/master/example.yml).
|
data/example.yml
CHANGED
@@ -10,7 +10,6 @@ class Alerty
|
|
10
10
|
@client = Dogapi::Client.new(config.api_key)
|
11
11
|
@subject = config.subject
|
12
12
|
@alert_type = config.alert_type
|
13
|
-
@source_type_name = config.source_type_name
|
14
13
|
@num_retries = config.num_retries || 3
|
15
14
|
end
|
16
15
|
|
@@ -20,8 +19,8 @@ class Alerty
|
|
20
19
|
timestamp = Time.now.to_i
|
21
20
|
retries = 0
|
22
21
|
begin
|
23
|
-
@client.emit_event(Dogapi::Event.new(message, :msg_title => subject, :alert_type => @alert_type, :
|
24
|
-
Alerty.logger.info "Sent #{{subject: subject, message: message}} to Datadog Event"
|
22
|
+
@client.emit_event(Dogapi::Event.new(message, :msg_title => subject, :alert_type => @alert_type, :date_happened => timestamp), :host => record[:hostname])
|
23
|
+
Alerty.logger.info "Sent #{{subject: subject, message: message, alert_type: @alert_type, date: timestamp, host: record[:hostname]}} to Datadog Event"
|
25
24
|
rescue => e
|
26
25
|
retries += 1
|
27
26
|
sleep 1
|