chef-handler-datadog 0.12.2 → 0.12.3

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
  SHA256:
3
- metadata.gz: b3608d27f3427fa1f07ecd1748fa02cc245ff15bceaf0ee7125707763d881122
4
- data.tar.gz: a1093543048a39d22ddea517d5791002d103c15cba4e375483131f8fa9cccea9
3
+ metadata.gz: b6d238ccc66981606466cca7e0a36098a7fd55e2372306193c5f80021a161fb7
4
+ data.tar.gz: ae15461ffab7b5421d7dd0dd56493eb4fd0f696e4a9497e733367445779b3d66
5
5
  SHA512:
6
- metadata.gz: 8878920f4498541aac73071a96249123012ed6fb6a0ff57d760da5287c653e0a81f08700052a2cc8a270f26c339429fc03251e850b8a653fb338016b60d46073
7
- data.tar.gz: 3d6887a1e64193c7783bf078fe2b62ebd2b43855169466768a2e78109b55725a8535d2e912d287fefa7515d5ec1fa82e71489aad20740cd9c0a3bd050cee95d4
6
+ metadata.gz: f6308f1d7226e514baadc27262489a5597bc959f0e8662cec44e5e88abc346975fe26a87759cf25fdbc411c625808f2f37c4fc4887c9f2ea94df74ae68ebcdba
7
+ data.tar.gz: '0669c141775ea7b269ba16c019052ecf52b3214846841b3f518281aa4fbb6a392936f759eed130ca272f49201192a9b782edce17b1e391a6085f523f4f711c23'
@@ -1,6 +1,10 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ # 0.12.3 / 2019-11-19
5
+
6
+ * [FEATURE] Use `api_url` to send Chef related data to extra endpoints. [#113][] [@Azoam][]
7
+
4
8
  # 0.12.2 / 2019-10-23
5
9
 
6
10
  * [OPTIMIZE] Rescue all errors when sending/emitting from the handler. [#98][] [@borgstrom][]
@@ -132,7 +136,9 @@ And all other versions were prior to this. See git history for more.
132
136
  [#103]: https://github.com/DataDog/chef-handler-datadog/issues/103
133
137
  [#104]: https://github.com/DataDog/chef-handler-datadog/issues/104
134
138
  [#109]: https://github.com/DataDog/chef-handler-datadog/issues/109
139
+ [#113]: https://github.com/DataDog/chef-handler-datadog/issues/113
135
140
  [@ABrehm264]: https://github.com/ABrehm264
141
+ [@Azoam]: https://github.com/Azoam
136
142
  [@DanielMuller]: https://github.com/DanielMuller
137
143
  [@DanielRedOak]: https://github.com/DanielRedOak
138
144
  [@alq]: https://github.com/alq
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ['lib']
16
16
  gem.extra_rdoc_files = ['README.md', 'LICENSE.txt']
17
17
 
18
- gem.add_dependency 'dogapi', '>= 1.31'
18
+ gem.add_dependency 'dogapi', '= 1.36.0'
19
19
 
20
20
  gem.add_development_dependency 'appraisal', '~> 2.0.1'
21
21
  gem.add_development_dependency 'bundler'
@@ -79,7 +79,7 @@ class Chef
79
79
  @event.emit_to_datadog dog
80
80
  @tags.send_update_to_datadog dog
81
81
  rescue => e
82
- Chef::Log.error("Could not send/emit to Datadog:\n" + e)
82
+ Chef::Log.error("Could not send/emit to Datadog:\n" + e.to_s)
83
83
  Chef::Log.error('Event data to be submitted was:')
84
84
  Chef::Log.error(@event.event_title)
85
85
  Chef::Log.error(@event.event_body)
@@ -159,7 +159,7 @@ class Chef
159
159
  # then add extra endpoints
160
160
  extra_endpoints = @config[:extra_endpoints] || []
161
161
  extra_endpoints.each do |endpoint|
162
- url = endpoint[:url] || config_url()
162
+ url = endpoint[:api_url] || endpoint[:url] || config_url()
163
163
  api_key = endpoint[:api_key]
164
164
  app_key = endpoint[:application_key]
165
165
  endpoints << [url, api_key, app_key] if validate_keys(api_key, app_key, false)
@@ -2,5 +2,5 @@
2
2
  # Helper module for version number only.
3
3
  # Real deal in 'chef/handler/datadog.rb'
4
4
  module ChefHandlerDatadog
5
- VERSION = '0.12.2'
5
+ VERSION = '0.12.3'
6
6
  end
@@ -734,6 +734,31 @@ describe Chef::Handler::Datadog, :vcr => :new_episodes do
734
734
  expect(handler.send(:endpoints)).to eq(triplets[0..1])
735
735
  end
736
736
  end
737
+
738
+ context 'when using api url instead of url' do
739
+ it 'returns available triplets' do
740
+ triplets = [
741
+ ['https://app.datadoghq.com', 'api_key_2' , 'app_key_2'],
742
+ ['https://app.example.com', 'api_key_3', 'app_key_3'],
743
+ ['https://app.example.com', 'api_key_4', 'app_key_4']
744
+ ]
745
+ handler = Chef::Handler::Datadog.new api_key: triplets[0][1],
746
+ application_key: triplets[0][2],
747
+ url: triplets[0][0],
748
+ extra_endpoints: [{
749
+ api_url: triplets[1][0],
750
+ url: triplets[0][0],
751
+ api_key: triplets[1][1],
752
+ application_key: triplets[1][2]
753
+ }, {
754
+ api_url: triplets[2][0],
755
+ url:triplets[0][0],
756
+ api_key: triplets[2][1],
757
+ application_key: triplets[2][2]
758
+ }]
759
+ expect(handler.send(:endpoints)).to eq(triplets)
760
+ end
761
+ end
737
762
  end
738
763
 
739
764
  context 'when reporting to multiple endpoints' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-handler-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Fiedler
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-10-23 00:00:00.000000000 Z
13
+ date: 2019-11-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dogapi
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: '1.31'
21
+ version: 1.36.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: '1.31'
28
+ version: 1.36.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: appraisal
31
31
  requirement: !ruby/object:Gem::Requirement