logstash-output-dynatrace 0.3.0 → 0.3.1

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: aefa283dfb7437921963fafa7f068d82363dd421506ebab8b146026f5ca7e30c
4
- data.tar.gz: d8843b75b161044bbc20cd6ee4b6f28777ff98bd2cab487e669240d662ce3e4a
3
+ metadata.gz: 06c22415ca3c16b7214c6aca478edd757db1302dff08fd706e80402bd3627392
4
+ data.tar.gz: af603917cd20c72d12d98add8409e1d171e7ca2edc632d42378f8a54f5a018a5
5
5
  SHA512:
6
- metadata.gz: 4ef069a726a4765d9d4395156ab4bfa13ddaf5aa83fe6934ffd8e610af6330f6ecca44a16de538d85551b7c416b8fd97340907a5b6ad6cdf1c8a0abf0b5fb2a2
7
- data.tar.gz: 244956ca7a924de908e05987eb5d13392c007c864f4462b51914ff766db8784aefc7e1b24eb52ff68a747e530f22f5233bb1af155a4ca461f8adce61dee605e9
6
+ metadata.gz: 0c5b60e14c175f9e7937c79131f872768034e191df4c12e9c58b88abcb190208148fb77d76c2d93e42aff8a2599e1b89621f165740910b0ee0561273f529fcc4
7
+ data.tar.gz: ad04bc45337935f619619bef6765dee1335285fc7fa705147bfdce7888f88158c829f62ad1a84f4a26c729710292143ffd8efa217954ce5c1bc9f4c458a64abe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.1
2
+ - Log and re-raise unknown errors
3
+ - Use [password](https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html#password) type for `api_key` configuration
4
+
1
5
  ## 0.3.0
2
6
  - Log response bodies on client errors
3
7
 
@@ -19,7 +19,7 @@ require 'logstash/outputs/base'
19
19
  require 'logstash/json'
20
20
 
21
21
  MAX_RETRIES = 5
22
- PLUGIN_VERSION = '0.3.0'
22
+ PLUGIN_VERSION = '0.3.1'
23
23
 
24
24
  module LogStash
25
25
  module Outputs
@@ -36,7 +36,7 @@ module LogStash
36
36
  config :ingest_endpoint_url, validate: :uri, required: true
37
37
 
38
38
  # The API token to use to authenticate requests to the log ingestion endpoint. Must have `logs.ingest` (Ingest Logs) scope.
39
- config :api_key, validate: :string, required: true
39
+ config :api_key, validate: :password, required: true
40
40
 
41
41
  # Disable SSL validation by setting :verify_mode OpenSSL::SSL::VERIFY_NONE
42
42
  config :ssl_verify_none, validate: :boolean, default: false
@@ -63,7 +63,7 @@ module LogStash
63
63
  {
64
64
  'User-Agent' => "logstash-output-dynatrace/#{PLUGIN_VERSION}",
65
65
  'Content-Type' => 'application/json; charset=utf-8',
66
- 'Authorization' => "Api-Token #{@api_key}"
66
+ 'Authorization' => "Api-Token #{@api_key.value}"
67
67
  }
68
68
  end
69
69
 
@@ -105,6 +105,9 @@ module LogStash
105
105
  @logger.error("Failed to export logs to Dynatrace.")
106
106
  return
107
107
  end
108
+ rescue StandardError => e
109
+ @logger.error("Unknown error raised", :error => e.inspect)
110
+ raise e
108
111
  end
109
112
  end
110
113
 
@@ -135,4 +135,17 @@ describe LogStash::Outputs::Dynatrace do
135
135
  subject.multi_receive(events)
136
136
  end
137
137
  end
138
+
139
+ context 'when an unknown error occurs' do
140
+ it 'logs and re-raises the error' do
141
+ class BadEvents
142
+ def length
143
+ 1
144
+ end
145
+ end
146
+
147
+ expect(subject.logger).to receive(:error)
148
+ expect { subject.multi_receive(BadEvents.new) }.to raise_error(StandardError)
149
+ end
150
+ end
138
151
  end
data/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
 
17
17
  module DynatraceConstants
18
18
  # Also required to change the version in lib/logstash/outputs/dynatrace.rb
19
- VERSION = '0.3.0'
19
+ VERSION = '0.3.1'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-dynatrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynatrace Open Source Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-06 00:00:00.000000000 Z
11
+ date: 2022-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-codec-json