datadog-notifications 0.4.6 → 0.4.7
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/Gemfile.lock +1 -1
- data/lib/datadog/notifications/config.rb +3 -1
- data/lib/datadog/notifications/version.rb +1 -1
- data/spec/datadog/notifications/config_spec.rb +15 -0
- 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: 1ceb379035ce65c48cb6d992e1a0294da716fbcc
|
4
|
+
data.tar.gz: 79930ea901deedc8d5087a58d636a2f10e00b2df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed1ec2c0bc244a56c0af5796a61f2363206c1b74fc3bf590d8c3ef9bdcbacdbd08d71ca1693c32fb9234287f749d7afdacc64b30a3db97b2b757475f49f1a3cf
|
7
|
+
data.tar.gz: c0a76f2f10812c86984ec37e173cc66d5c0c432a7bc006f473cd3469f2519c71c5206b9821f194363f740c295acd5411ffe9a10627db3968ab70e05bff807c85
|
data/Gemfile.lock
CHANGED
@@ -20,7 +20,9 @@ module Datadog
|
|
20
20
|
def connect!
|
21
21
|
env = ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
22
22
|
tags.push("env:#{env}") if env && tags.none? {|t| t =~ /^env\:/ }
|
23
|
-
|
23
|
+
|
24
|
+
enable_hostname = hostname && hostname != 'false'
|
25
|
+
tags.push("host:#{hostname}") if enable_hostname && tags.none? {|t| t =~ /^host\:/ }
|
24
26
|
|
25
27
|
reporter.new statsd_host, statsd_port, namespace: namespace, tags: tags
|
26
28
|
end
|
@@ -12,6 +12,21 @@ describe Datadog::Notifications::Config do
|
|
12
12
|
expect(subject.tags).to eq(["custom:tag", "env:test", "host:test.host"])
|
13
13
|
end
|
14
14
|
|
15
|
+
RSpec.shared_examples 'host tag is not picked up' do |hostname|
|
16
|
+
it 'should not pick up the host tag' do
|
17
|
+
subject.reporter = Mock::Reporter
|
18
|
+
subject.hostname = hostname
|
19
|
+
subject.tags = ["custom:tag"]
|
20
|
+
|
21
|
+
client = subject.send(:connect!)
|
22
|
+
expect(client).to be_instance_of(Mock::Reporter)
|
23
|
+
expect(subject.tags).to eq(["custom:tag", "env:test"])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
include_examples 'host tag is not picked up', false
|
28
|
+
include_examples 'host tag is not picked up', 'false'
|
29
|
+
|
15
30
|
it 'should instantiate plugins on use' do
|
16
31
|
subject.use Datadog::Notifications::Plugins::ActionController
|
17
32
|
expect(subject.plugins.size).to eq(1)
|