datadog-notifications 0.4.6 → 0.4.7

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: 69c40e89aa06bcf6fd1b0f04cbf0dd21cc481e29
4
- data.tar.gz: 67577d7cab57a349dd0c9baeadffcf84306495a4
3
+ metadata.gz: 1ceb379035ce65c48cb6d992e1a0294da716fbcc
4
+ data.tar.gz: 79930ea901deedc8d5087a58d636a2f10e00b2df
5
5
  SHA512:
6
- metadata.gz: '025799052026b754667d0a964406e88150e4ce1a8db4c5c26cfc267a0f163b243416fb71b9e858b0376db6768001433d098c3ef1c44368a430662c529ff198b0'
7
- data.tar.gz: 05ec7ea5b5e0d42d61a1e32804d76ef3fa0659dd0d614e2974872ea1e53fb050d26e162537261d9c2a6796cec633340207571246927381d06658be029210f756
6
+ metadata.gz: ed1ec2c0bc244a56c0af5796a61f2363206c1b74fc3bf590d8c3ef9bdcbacdbd08d71ca1693c32fb9234287f749d7afdacc64b30a3db97b2b757475f49f1a3cf
7
+ data.tar.gz: c0a76f2f10812c86984ec37e173cc66d5c0c432a7bc006f473cd3469f2519c71c5206b9821f194363f740c295acd5411ffe9a10627db3968ab70e05bff807c85
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datadog-notifications (0.4.6)
4
+ datadog-notifications (0.4.7)
5
5
  activesupport
6
6
  dogstatsd-ruby (~> 3.0.0)
7
7
 
@@ -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
- tags.push("host:#{hostname}") if tags.none? {|t| t =~ /^host\:/ }
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
@@ -1,5 +1,5 @@
1
1
  module Datadog
2
2
  class Notifications
3
- VERSION = "0.4.6"
3
+ VERSION = "0.4.7"
4
4
  end
5
5
  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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko