alerty-plugin-datadog_event 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f6f37d2ede15b4d93920d7e006af6eec5bf8a73
4
- data.tar.gz: 6fe8c620b23ccb547b2732bb90cbf029a4872805
3
+ metadata.gz: aad239a4fcc28f7b0542a5eee49aeb4738e6beb7
4
+ data.tar.gz: cb0f5b59f6232a17bc637897d4f591db3e6ac152
5
5
  SHA512:
6
- metadata.gz: 544d9e1fdf2d6094c9609300a7a8f29bcfdefb6a9952d9c2c3b52c0108d1f6af5a71b65a5937700daaa117edeec3ed75ea1435c6a2bbb4a9fa4edf7a52e8243f
7
- data.tar.gz: c29c17c2892df522701003b1fda973f2f11b38373ac3a57b9ccf64f00a6e58749d79a1e9723732fa1eba07580d50da6789bcc345e41e6c1f82dd5f01b268ae91
6
+ metadata.gz: 2d67bed5f978a2cdd6f608da0d2b9b4dc8d94723e7093034f7702e3ad490ee6129344363ccc76468720c3c317987f68cd1c24300915f47e0037048f0462f7675
7
+ data.tar.gz: 72549994b4dd4706fda2b3ddc2b955566334dda9ac57e8573cf95f81883141f9145e5b978affed92a974cd3cfa221d147a83e3603c86b2cb3b55f1347342300f
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ test.yml
11
+ test.rb
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
- subject: "FAILURE [${hostname}] : ${command}"
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).
@@ -7,4 +7,3 @@ plugins:
7
7
  api_key: API_KEY
8
8
  subject: "FAILURE [${hostname}] : ${command}"
9
9
  alert_type: error
10
- source_type_name : cron_job
@@ -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, :source_type_name => @source_type_name ,:date_happened => timestamp), :host => record[:hostname])
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
@@ -1,7 +1,7 @@
1
1
  module Alerty
2
2
  module Plugin
3
3
  module DatadogEvent
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alerty-plugin-datadog_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yohei Kawahara(inokappa)