datadog-notifications 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/.travis.yml +4 -3
- data/Gemfile.lock +34 -32
- data/datadog-notifications.gemspec +0 -1
- data/lib/datadog/notifications.rb +2 -2
- data/lib/datadog/notifications/config.rb +2 -1
- data/lib/datadog/notifications/plugins/grape.rb +4 -4
- data/lib/datadog/notifications/plugins/grpc.rb +2 -2
- data/lib/datadog/notifications/version.rb +1 -1
- data/spec/datadog/notifications/plugins/active_record_spec.rb +4 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad10b73b565812d444474c765e3f8e1054776e7f35205ca0b3e1d81e79413ad
|
4
|
+
data.tar.gz: db63472562524db432806070e6c6c64f32fbf848eed7fd775761fb7fe0189cbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f872dfd2ea075f5e2562f81ff149a7e5434d603cbda8013d1faf323fa33800543fb48c5ef5434fe40f51b4bf3ef6baa71437dd73947dcf0131a3acd96da0000
|
7
|
+
data.tar.gz: b650ab31ce04c9383e88b4eda57cfd7d3d907ebd5b62a0e44ae8258b820131fbf721bbc3fd10927299bb328786e0f6580e42c17ff80d9dbb8b0bb356e70bbac5
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datadog-notifications (0.5.
|
4
|
+
datadog-notifications (0.5.3)
|
5
5
|
activesupport
|
6
6
|
dogstatsd-ruby (~> 3.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (5.1
|
12
|
-
activesupport (= 5.1
|
13
|
-
activerecord (5.1
|
14
|
-
activemodel (= 5.1
|
15
|
-
activesupport (= 5.1
|
16
|
-
arel (
|
17
|
-
activesupport (5.1
|
11
|
+
activemodel (5.2.1)
|
12
|
+
activesupport (= 5.2.1)
|
13
|
+
activerecord (5.2.1)
|
14
|
+
activemodel (= 5.2.1)
|
15
|
+
activesupport (= 5.2.1)
|
16
|
+
arel (>= 9.0)
|
17
|
+
activesupport (5.2.1)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (>= 0.7, < 2)
|
20
20
|
minitest (~> 5.1)
|
21
21
|
tzinfo (~> 1.1)
|
22
|
-
arel (
|
22
|
+
arel (9.0.0)
|
23
23
|
ast (2.4.0)
|
24
24
|
axiom-types (0.1.1)
|
25
25
|
descendants_tracker (~> 0.0.4)
|
@@ -34,57 +34,59 @@ GEM
|
|
34
34
|
diff-lcs (1.3)
|
35
35
|
dogstatsd-ruby (3.3.0)
|
36
36
|
equalizer (0.0.11)
|
37
|
-
grape (1.0
|
37
|
+
grape (1.1.0)
|
38
38
|
activesupport
|
39
39
|
builder
|
40
40
|
mustermann-grape (~> 1.0.0)
|
41
41
|
rack (>= 1.3.0)
|
42
42
|
rack-accept
|
43
43
|
virtus (>= 1.0.0)
|
44
|
-
i18n (1.
|
44
|
+
i18n (1.1.0)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
46
|
ice_nine (0.11.2)
|
47
|
+
jaro_winkler (1.5.1)
|
47
48
|
minitest (5.11.3)
|
48
|
-
mustermann (1.0.
|
49
|
+
mustermann (1.0.3)
|
49
50
|
mustermann-grape (1.0.0)
|
50
51
|
mustermann (~> 1.0.0)
|
51
52
|
parallel (1.12.1)
|
52
|
-
parser (2.5.
|
53
|
+
parser (2.5.1.2)
|
53
54
|
ast (~> 2.4.0)
|
54
|
-
powerpack (0.1.
|
55
|
-
rack (2.0.
|
55
|
+
powerpack (0.1.2)
|
56
|
+
rack (2.0.5)
|
56
57
|
rack-accept (0.4.5)
|
57
58
|
rack (>= 0.4)
|
58
|
-
rack-test (1.
|
59
|
+
rack-test (1.1.0)
|
59
60
|
rack (>= 1.0, < 3)
|
60
61
|
rainbow (3.0.0)
|
61
62
|
rake (12.3.1)
|
62
|
-
rspec (3.
|
63
|
-
rspec-core (~> 3.
|
64
|
-
rspec-expectations (~> 3.
|
65
|
-
rspec-mocks (~> 3.
|
66
|
-
rspec-core (3.
|
67
|
-
rspec-support (~> 3.
|
68
|
-
rspec-expectations (3.
|
63
|
+
rspec (3.8.0)
|
64
|
+
rspec-core (~> 3.8.0)
|
65
|
+
rspec-expectations (~> 3.8.0)
|
66
|
+
rspec-mocks (~> 3.8.0)
|
67
|
+
rspec-core (3.8.0)
|
68
|
+
rspec-support (~> 3.8.0)
|
69
|
+
rspec-expectations (3.8.1)
|
69
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-mocks (3.
|
71
|
+
rspec-support (~> 3.8.0)
|
72
|
+
rspec-mocks (3.8.0)
|
72
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-support (3.
|
75
|
-
rubocop (0.
|
74
|
+
rspec-support (~> 3.8.0)
|
75
|
+
rspec-support (3.8.0)
|
76
|
+
rubocop (0.59.0)
|
77
|
+
jaro_winkler (~> 1.5.1)
|
76
78
|
parallel (~> 1.10)
|
77
|
-
parser (>= 2.5)
|
79
|
+
parser (>= 2.5, != 2.5.1.1)
|
78
80
|
powerpack (~> 0.1)
|
79
81
|
rainbow (>= 2.2.2, < 4.0)
|
80
82
|
ruby-progressbar (~> 1.7)
|
81
83
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
82
|
-
ruby-progressbar (1.
|
84
|
+
ruby-progressbar (1.10.0)
|
83
85
|
sqlite3 (1.3.13)
|
84
86
|
thread_safe (0.3.6)
|
85
87
|
tzinfo (1.2.5)
|
86
88
|
thread_safe (~> 0.1)
|
87
|
-
unicode-display_width (1.
|
89
|
+
unicode-display_width (1.4.0)
|
88
90
|
virtus (1.0.5)
|
89
91
|
axiom-types (~> 0.1)
|
90
92
|
coercible (~> 1.0)
|
@@ -106,4 +108,4 @@ DEPENDENCIES
|
|
106
108
|
sqlite3
|
107
109
|
|
108
110
|
BUNDLED WITH
|
109
|
-
1.16.
|
111
|
+
1.16.4
|
@@ -18,6 +18,8 @@ module Datadog
|
|
18
18
|
@plugins.push klass.new(opts)
|
19
19
|
end
|
20
20
|
|
21
|
+
protected
|
22
|
+
|
21
23
|
def connect!
|
22
24
|
env = ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
23
25
|
tags.push("env:#{env}") if env && tags.none? {|t| t =~ /^env\:/ }
|
@@ -27,7 +29,6 @@ module Datadog
|
|
27
29
|
|
28
30
|
reporter.new statsd_host, statsd_port, namespace: namespace, tags: tags, socket_path: socket_path
|
29
31
|
end
|
30
|
-
protected :connect!
|
31
32
|
|
32
33
|
end
|
33
34
|
end
|
@@ -47,10 +47,10 @@ module Datadog::Notifications::Plugins
|
|
47
47
|
|
48
48
|
def extract_path(endpoint)
|
49
49
|
route = begin
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
endpoint.route
|
51
|
+
rescue NoMethodError
|
52
|
+
nil
|
53
|
+
end
|
54
54
|
return endpoint.request.path unless route
|
55
55
|
|
56
56
|
path = endpoint.route.path.dup
|
@@ -29,8 +29,8 @@ module Datadog::Notifications::Plugins
|
|
29
29
|
tags = self.tags + %W[action:#{action} status:#{status}]
|
30
30
|
|
31
31
|
reporter.batch do
|
32
|
-
reporter.increment metric_name, tags: tags
|
33
|
-
reporter.timing "#{metric_name}.time", event.duration, tags: tags
|
32
|
+
reporter.increment @metric_name, tags: tags
|
33
|
+
reporter.timing "#{@metric_name}.time", event.duration, tags: tags
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -4,23 +4,18 @@ describe Datadog::Notifications::Plugins::ActiveRecord do
|
|
4
4
|
|
5
5
|
it 'should send an increment and timing event for each query' do
|
6
6
|
Post.all.to_a
|
7
|
-
expect(buffered).to eq
|
7
|
+
expect(buffered).to eq [
|
8
8
|
"activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load",
|
9
9
|
"activerecord.sql.time:333|ms|#custom:tag,env:test,host:test.host,query:post.load",
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should skip unnamed by default' do
|
14
|
-
Post.create!(title: "Hello!")
|
15
|
-
expect(buffered).to eq([])
|
10
|
+
]
|
16
11
|
end
|
17
12
|
|
18
13
|
it 'should support custom queries' do
|
19
14
|
Post.find_by_sql("SELECT * FROM posts LIMIT 1").to_a
|
20
|
-
expect(buffered).to eq
|
15
|
+
expect(buffered).to eq [
|
21
16
|
"activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load",
|
22
17
|
"activerecord.sql.time:333|ms|#custom:tag,env:test,host:test.host,query:post.load",
|
23
|
-
]
|
18
|
+
]
|
24
19
|
end
|
25
20
|
|
26
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datadog-notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.7.
|
206
|
+
rubygems_version: 2.7.6
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Generic ActiveSupport::Notifications Datadog handler
|