datadog-notifications 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/Gemfile.lock +1 -1
- data/datadog-notifications.gemspec +7 -7
- data/lib/datadog/notifications/plugins/grpc.rb +4 -3
- data/lib/datadog/notifications/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b5f03fc020837e2cfaa38c03d714f072b708c297e769a9320cde3101c7e9f0d
|
4
|
+
data.tar.gz: fd49a100718f546dbc09a1fc463e375ebd5a11fdbfd17c99a952094d300af549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f3cf72e5b385ebdf83da7313fa4275996a4db3b65882b686c518d6c35cde0978a030dd283deefdccd71df6dff00952c957496e9eb5a5904f3a5eefc8c009d60
|
7
|
+
data.tar.gz: ed7924531864e5cdc77affb11f1241b93bc1d76836784a4222fd036ab5788465c9b26bd458aafb911d12cf5a58bb19da92c58e3a5b8f5180146ff76c57a2eaad
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,24 +3,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require 'datadog/notifications/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = 'datadog-notifications'
|
7
7
|
s.version = Datadog::Notifications::VERSION.dup
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
8
|
+
s.authors = ['Dimitrij Denissenko']
|
9
|
+
s.email = ['dimitrij@blacksquaremedia.com']
|
10
10
|
s.description = 'Datadog instrumentation for ActiveSupport::Notifications'
|
11
11
|
s.summary = 'Generic ActiveSupport::Notifications Datadog handler'
|
12
|
-
s.homepage =
|
12
|
+
s.homepage = 'https://github.com/bsm/datadog-notifications'
|
13
13
|
|
14
14
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
15
15
|
s.test_files = s.files.grep(%r{^(spec)/})
|
16
|
-
s.require_paths = [
|
16
|
+
s.require_paths = ['lib']
|
17
17
|
|
18
18
|
s.add_runtime_dependency('activesupport')
|
19
|
-
s.add_runtime_dependency('dogstatsd-ruby',
|
19
|
+
s.add_runtime_dependency('dogstatsd-ruby', '~> 3.1')
|
20
20
|
|
21
21
|
s.add_development_dependency('activerecord')
|
22
22
|
s.add_development_dependency('bundler')
|
23
|
-
s.add_development_dependency('grape',
|
23
|
+
s.add_development_dependency('grape', '>= 0.16')
|
24
24
|
s.add_development_dependency('rack-test')
|
25
25
|
s.add_development_dependency('rake')
|
26
26
|
s.add_development_dependency('rspec')
|
@@ -7,9 +7,9 @@ module Datadog::Notifications::Plugins
|
|
7
7
|
# *<tt>:tags</tt> - additional tags
|
8
8
|
#
|
9
9
|
# It expects ActiveSupport instrumented notifications named 'process_action.grpc'.
|
10
|
-
#
|
10
|
+
# Notification payload should have :service (service name, string) and :action (service action/method name, string) keys.
|
11
11
|
#
|
12
|
-
# Compatible instrumentation is implemented in grpcx gem: https://github.com/bsm/grpcx
|
12
|
+
# Compatible instrumentation is implemented in grpcx gem: https://github.com/bsm/grpcx (>= 0.2.0)
|
13
13
|
def initialize(opts={})
|
14
14
|
super
|
15
15
|
@metric_name = opts[:metric_name] || 'grpc.request'
|
@@ -23,10 +23,11 @@ module Datadog::Notifications::Plugins
|
|
23
23
|
|
24
24
|
def record(reporter, event)
|
25
25
|
payload = event.payload
|
26
|
+
service = payload[:service]
|
26
27
|
action = payload[:action]
|
27
28
|
status = payload[:exception] ? 'error' : 'ok'
|
28
29
|
|
29
|
-
tags = self.tags + %W[action:#{action} status:#{status}]
|
30
|
+
tags = self.tags + %W[service:#{service} action:#{action} status:#{status}]
|
30
31
|
|
31
32
|
reporter.batch do
|
32
33
|
reporter.increment @metric_name, tags: tags
|