fluent-plugin-out-http 1.3.2 → 1.3.4

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: ad31d6d8e6d5c91ed3d8de4001209423ac88ab0b4874ff20ca2ad6fc4da1eb61
4
- data.tar.gz: 5b51d999c640acc0e8bdae3dc4f057648ccbb76bcc79e8b10d96dfacf5ea7c8f
3
+ metadata.gz: fc6b6a32252a6bd023ff50a7785ad1c761f0e0de88fd791cf80a03b4e03313c3
4
+ data.tar.gz: 35f04c05e359cc78d9a2305a8b157439c930254d23ad032c5a57496506d21a84
5
5
  SHA512:
6
- metadata.gz: c26560e9256fdd166b1a909b5b166c5fe5a7d14f5b9ebc01c8a125bd74c6feb859ee744853a3e3925e7ad6e58175c3be7e45d991eca54716f1a62d10981fad5b
7
- data.tar.gz: acb1c8e0131912640da47d2e632f91cd7c4986327878a60ea224905c52eb4d545e5e1d8cab6c2abe22a3030764733d9dba22ba6443845319c4850f7bf150407b
6
+ metadata.gz: 14be9f2277907f3cf48a5388568b80a4a91f5daa6a0af8e0b24fd19510fdf0c0bad5c51dcc6338a2a61058907bffa9c5c95bf333a15d6a7ef5bc99a955c7e051
7
+ data.tar.gz: 27ae799e130b2469947cee7f603477fba5fdd80cffa5041929cb7bfaa4948ce656d90cd349ccdf8884c8616758f79b2263e158b00dc8831a926462e8ce5757b2
@@ -0,0 +1,43 @@
1
+ name: Test
2
+ on:
3
+ - push
4
+ - pull_request
5
+ jobs:
6
+ build:
7
+ runs-on: ${{ matrix.os }}
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: [ '2.7', '3.0', '3.1' ]
12
+ os:
13
+ - ubuntu-latest
14
+ - macOS-latest
15
+ name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ bundler-cache: true
22
+ - name: unit testing
23
+ run: |
24
+ bundle exec rake test
25
+
26
+ gem:
27
+ name: Gem test
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v3
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 3.1
34
+ - name: Install
35
+ run: |
36
+ rake install
37
+ gem install test-unit webrick
38
+ - name: Test
39
+ run: |
40
+ mkdir -p tmp
41
+ cd tmp
42
+ cp -a ../test/ ./
43
+ ../run_test.rb
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
+ ## 1.3.4
3
+ * Add debug log about chunk writing
4
+ * Tweak CI
5
+
6
+ ## 1.3.3
7
+ * Revert x-ndjson format payload behavior
2
8
 
3
9
  ## 1.3.2
4
10
  * Fix invalid x-ndjson payload format
data/README.md CHANGED
@@ -2,8 +2,38 @@
2
2
 
3
3
  A generic [fluentd][1] output plugin for sending logs to an HTTP endpoint.
4
4
 
5
+ **NOTE:** This plugin name is overlapped from Fluentd core plugin which name is `out_http`. But core plugin does not provide buffered/non-buffered switch and batch/non-batch request switch. If you want to use these switch features. Please consider to use this plugin.
6
+
5
7
  [![Build Status](https://travis-ci.org/fluent-plugins-nursery/fluent-plugin-out-http.svg?branch=master)](https://travis-ci.org/fluent-plugins-nursery/fluent-plugin-out-http)
6
8
 
9
+ ## Installation
10
+
11
+ ### For bundler
12
+
13
+ Write the following line in Gemfile:
14
+
15
+ ```gemfile
16
+ gem "fluent-plugin-out-http"
17
+ ```
18
+
19
+ and then,
20
+
21
+ ```console
22
+ $ bundle install
23
+ ```
24
+
25
+ ### for fluentd
26
+
27
+ ```console
28
+ $ fluent-gem install fluent-plugin-out-http
29
+ ```
30
+
31
+ ### For td-agent
32
+
33
+ ```console
34
+ $ td-agent-gem install fluent-plugin-out-http
35
+ ```
36
+
7
37
  ## Configuration options
8
38
 
9
39
  <match *>
@@ -45,3 +75,11 @@ Heavily based on [fluent-plugin-growthforecast][2]
45
75
  [1]: http://fluentd.org/
46
76
  [2]: https://github.com/tagomoris/fluent-plugin-growthforecast
47
77
  [3]: https://github.com/sabottenda/fluent-plugin-bufferize
78
+
79
+ ## How to release
80
+
81
+ 1. Update `gem.version` of the `gemspec` file.
82
+ 1. Update `CHANGELOG.md`.
83
+ 1. Commit them.
84
+ 1. `$ bundle exec rake release`
85
+ * It will add and push the tag, and publish the gem.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "fluent-plugin-out-http"
5
- gem.version = "1.3.2"
5
+ gem.version = "1.3.4"
6
6
  gem.authors = ["Marica Odagaki"]
7
7
  gem.email = ["ento.entotto@gmail.com"]
8
8
  gem.summary = %q{A generic Fluentd output plugin to send logs to an HTTP endpoint}
@@ -22,4 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_development_dependency "bundler"
23
23
  gem.add_development_dependency "rake"
24
24
  gem.add_development_dependency "test-unit", ">= 3.1.0"
25
+ gem.add_development_dependency "webrick"
25
26
  end
@@ -174,7 +174,7 @@ class Fluent::Plugin::HTTPOutput < Fluent::Plugin::Output
174
174
  end
175
175
 
176
176
  def set_bulk_body(req, data)
177
- req.body = Yajl.dump(data)
177
+ req.body = data.to_s
178
178
  req['Content-Type'] = 'application/x-ndjson'
179
179
  compress_body(req, req.body)
180
180
  end
@@ -302,6 +302,9 @@ class Fluent::Plugin::HTTPOutput < Fluent::Plugin::Output
302
302
  def write(chunk)
303
303
  tag = chunk.metadata.tag
304
304
  @endpoint_url = extract_placeholders(@endpoint_url, chunk)
305
+
306
+ log.debug { "#{@http_method.capitalize} data to #{@endpoint_url} with chunk(#{dump_unique_id_hex(chunk.unique_id)})" }
307
+
305
308
  if @bulk_request
306
309
  time = Fluent::Engine.now
307
310
  handle_records(tag, time, chunk)
data/run_test.rb ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ Dir.glob("test/**/test_*.rb") do |test_rb|
3
+ require File.expand_path(test_rb)
4
+ end
@@ -471,21 +471,21 @@ class HTTPOutputTest < HTTPOutputTestBase
471
471
  assert_equal 1, @posts.size
472
472
  record = @posts[0]
473
473
 
474
- expected = [
475
- Yajl.dump({
474
+ expected =[
475
+ {
476
+ "binary" => "\u3042",
476
477
  "field1" => 50,
477
478
  "field2" => 20,
478
479
  "field3" => 10,
479
- "otherfield" => 1,
480
+ "otherfield" => 1
481
+ },
482
+ {
480
483
  "binary" => "\u3042",
481
- }) + "\n" +
482
- Yajl.dump({
483
484
  "field1" => 70,
484
485
  "field2" => 30,
485
486
  "field3" => 20,
486
- "otherfield" => 2,
487
- "binary" => "\u3042",
488
- }) + "\n"
487
+ "otherfield" => 2
488
+ }
489
489
  ]
490
490
 
491
491
  assert_equal expected, record[:x_ndjson]
@@ -503,21 +503,21 @@ class HTTPOutputTest < HTTPOutputTestBase
503
503
  assert_equal 1, @posts.size
504
504
  record = @posts[0]
505
505
 
506
- expected = [
507
- Yajl.dump({
506
+ expected =[
507
+ {
508
+ "binary" => "\u3042",
508
509
  "field1" => 50,
509
510
  "field2" => 20,
510
511
  "field3" => 10,
511
- "otherfield" => 1,
512
+ "otherfield" => 1
513
+ },
514
+ {
512
515
  "binary" => "\u3042",
513
- }) + "\n" +
514
- Yajl.dump({
515
516
  "field1" => 70,
516
517
  "field2" => 30,
517
518
  "field3" => 20,
518
- "otherfield" => 2,
519
- "binary" => "\u3042",
520
- }) + "\n"
519
+ "otherfield" => 2
520
+ }
521
521
  ]
522
522
 
523
523
  assert_equal expected, record[:x_ndjson]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-out-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marica Odagaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2022-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yajl-ruby
@@ -86,6 +86,20 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: 3.1.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: webrick
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
89
103
  description: A generic Fluentd output plugin to send logs to an HTTP endpoint
90
104
  email:
91
105
  - ento.entotto@gmail.com
@@ -93,8 +107,8 @@ executables: []
93
107
  extensions: []
94
108
  extra_rdoc_files: []
95
109
  files:
110
+ - ".github/workflows/test.yml"
96
111
  - ".gitignore"
97
- - ".travis.yml"
98
112
  - CHANGELOG.md
99
113
  - Gemfile
100
114
  - ISSUE_TEMPLATE.md
@@ -104,6 +118,7 @@ files:
104
118
  - fluent-plugin-out-http.gemspec
105
119
  - lib/fluent/plugin/out_http.rb
106
120
  - lib/fluent/test/http_output_test.rb
121
+ - run_test.rb
107
122
  - test/plugin/script/plugin/formatter_test.rb
108
123
  - test/plugin/test_out_http.rb
109
124
  homepage: https://github.com/fluent-plugins-nursery/fluent-plugin-out-http
@@ -125,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
140
  - !ruby/object:Gem::Version
126
141
  version: '0'
127
142
  requirements: []
128
- rubygems_version: 3.0.3
143
+ rubygems_version: 3.1.6
129
144
  signing_key:
130
145
  specification_version: 4
131
146
  summary: A generic Fluentd output plugin to send logs to an HTTP endpoint
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- rvm:
2
- - 2.2
3
- - 2.3
4
- - 2.4.5
5
- - 2.5.3
6
- - 2.6.0
7
- - ruby-head
8
-
9
- os:
10
- - linux
11
- - osx
12
-
13
- dist: trusty
14
-
15
- gemfile:
16
- - Gemfile
17
-
18
- before_install:
19
- - gem update --system=2.7.8
20
-
21
- script: bundle exec rake test
22
-
23
- matrix:
24
- allow_failures:
25
- - rvm: ruby-head