logstash-output-honeycomb_json_batch 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: d0021f21a46eb6dfb4685f88f6a3350e8c32e7e9
4
- data.tar.gz: b1838276379b83acb24f4b6c13836922ebb8028c
3
+ metadata.gz: e766e09300c1d2d2edd9b61f711365717c1325bc
4
+ data.tar.gz: e2ce01c2e02807d5d45576c92a063993a0dbc04b
5
5
  SHA512:
6
- metadata.gz: f01e1628b5af907e299762afbf2fb2911beabbda20dd1a37db185af9b80e641a5f211d521a8a211a80394c3b682fc7748d3bf5e725cd08690030b89cb4256637
7
- data.tar.gz: 786eeb856cafd6e6e5e30ab31faeb00748650d58081835f4fb7337ed2bfa4b14f0914bf8522d44a392a5e637bd72e20e77bd10a1823bb50d35339e8646a3ba20
6
+ metadata.gz: 7bed196cb2b70be12e3d7a72a00b70008682dd385e786853023e5f7465e722285bf9380f938093e54bcf609cd9bd5869b132b5daa88a850d755755957d5f5b02
7
+ data.tar.gz: 56bec4d327e7bd3745967839e54e91ca7151a4322b51595b166b40ab41186e186ebe46f7f5860e1aedba9ccf8dfd59f6b14effae944c005ba94cdec0f40b820b
@@ -28,6 +28,8 @@ class LogStash::Outputs::HoneycombJSONBatch < LogStash::Outputs::Base
28
28
 
29
29
  config :pool_max, :validate => :number, :default => 10
30
30
 
31
+ VERSION = "0.2.1"
32
+
31
33
  def register
32
34
  @total = 0
33
35
  @total_failed = 0
@@ -78,10 +80,12 @@ class LogStash::Outputs::HoneycombJSONBatch < LogStash::Outputs::Base
78
80
  request.on_success do |response|
79
81
  if response.code >= 200 && response.code < 300
80
82
  @total = @total + documents.length
81
- @logger.debug("Successfully submitted",
82
- :docs => documents.length,
83
+ @logger.debug("Successfully submitted batch",
84
+ :num_docs => documents.length,
83
85
  :response_code => response.code,
84
- :total => @total)
86
+ :total => @total,
87
+ :thread_id => Thread.current.object_id,
88
+ :time => Time::now.utc)
85
89
  else
86
90
  if documents.length > 1 && @retry_individual
87
91
  if statuses = JSON.parse(response.body).values.first
@@ -124,6 +128,11 @@ class LogStash::Outputs::HoneycombJSONBatch < LogStash::Outputs::Base
124
128
  )
125
129
  end
126
130
 
131
+ @logger.debug("Submitting batch",
132
+ :num_docs => documents.length,
133
+ :total => @total,
134
+ :thread_id => Thread.current.object_id,
135
+ :time => Time::now.utc)
127
136
  request.call
128
137
 
129
138
  rescue Exception => e
@@ -138,7 +147,8 @@ class LogStash::Outputs::HoneycombJSONBatch < LogStash::Outputs::Base
138
147
  def request_headers()
139
148
  {
140
149
  "Content-Type" => "application/json",
141
- "X-Honeycomb-Team" => @write_key
150
+ "X-Honeycomb-Team" => @write_key,
151
+ "X-Plugin-Version" => VERSION
142
152
  }
143
153
  end
144
154
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-honeycomb_json_batch'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "This output lets you `POST` batches of events to the Honeycomb.io API endpoint"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -44,7 +44,8 @@ describe LogStash::Outputs::HoneycombJSONBatch do
44
44
  expect(client).to receive(:post).
45
45
  with("#{ api_host }/1/batch", hash_including(:headers => {
46
46
  "Content-Type" => "application/json",
47
- "X-Honeycomb-Team" => WRITE_KEY
47
+ "X-Honeycomb-Team" => WRITE_KEY,
48
+ "X-Plugin-Version" => LogStash::Outputs::HoneycombJSONBatch::VERSION
48
49
  })).once.
49
50
  and_call_original
50
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-honeycomb_json_batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeycomb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-16 00:00:00.000000000 Z
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api