fluent-plugin-influxdb-v2 1.5.0.pre.579

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 40fc3a77519eb924067e9e24c5ba23031c2c4ff094a71b7d2c30c4240dd11545
4
+ data.tar.gz: 821c9bbad210f576e6bbf63f0d017e2b40703e46e41d529b61be90671cdb577a
5
+ SHA512:
6
+ metadata.gz: 31753f9a516f0854013b47ad33804cefc26ffd15f09ed75cd42abdf70ba7e9b551c2d062d82b201e0fc4d724e208fd45ad09adc26c080e207d2ee40e95be7eee
7
+ data.tar.gz: 6024938aa8c653a12b4e79b0f81611b3a66624a946c1940e7ff479b6e114b884ef98d8bc79cc6ffa2821b7d5fb9e5efe0bb9ae5fdcafbed2094f5260318014b7
@@ -0,0 +1,157 @@
1
+ #
2
+ # The MIT License
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #
22
+
23
+ version: 2.1
24
+
25
+ commands:
26
+ influxdb-onboarding:
27
+ steps:
28
+ - run:
29
+ name: "Post onBoarding request to InfluxDB 2"
30
+ command: ./bin/influxdb-onboarding.sh
31
+ prepare:
32
+ description: "Prepare environment to tests"
33
+ steps:
34
+ - checkout
35
+ - influxdb-onboarding
36
+ test:
37
+ parameters:
38
+ ruby-image:
39
+ type: string
40
+ steps:
41
+ - restore_cache:
42
+ name: Restoring Gem Cache
43
+ keys:
44
+ - &cache-key gem-cache-{{ checksum "fluent-plugin-influxdb-v2.gemspec" }}-<< parameters.ruby-image >>
45
+ - gem-cache-{{ checksum "fluent-plugin-influxdb-v2.gemspec" }}
46
+ - gem-cache-
47
+ - run:
48
+ name: Install dependencies
49
+ command: |
50
+ gem install bundler
51
+ bundle config set path 'vendor/bundle'
52
+ bundle install --jobs=4 --retry=3
53
+ - run:
54
+ name: Static code analyze
55
+ command: |
56
+ bundle exec rake rubocop
57
+ - run:
58
+ name: Run tests
59
+ command: |
60
+ export MINITEST_REPORTER=JUnitReporter
61
+ bundle exec rake test
62
+ - save_cache:
63
+ name: Saving Gem Cache
64
+ key: *cache-key
65
+ paths:
66
+ - ./vendor/bundle
67
+ when: always
68
+ storing-test-results:
69
+ steps:
70
+ - store_test_results:
71
+ path: test/reports
72
+
73
+ jobs:
74
+ tests-ruby:
75
+ parameters:
76
+ ruby-image:
77
+ type: string
78
+ default: &default-ruby-image "circleci/ruby:2.6-stretch"
79
+ influxdb-image:
80
+ type: string
81
+ default: &default-influxdb-image "influxdb:2.0.0-beta"
82
+ docker:
83
+ - image: << parameters.ruby-image >>
84
+ - image: &influx-image quay.io/influxdb/<< parameters.influxdb-image >>
85
+ steps:
86
+ - prepare
87
+ - test:
88
+ ruby-image: << parameters.ruby-image >>
89
+ - storing-test-results
90
+
91
+ deploy-preview:
92
+ parameters:
93
+ influxdb-image:
94
+ type: string
95
+ default: *default-influxdb-image
96
+ docker:
97
+ - image: *default-ruby-image
98
+ - image: *influx-image
99
+ steps:
100
+ - run:
101
+ name: Early return if this build is from a forked repository
102
+ command: |
103
+ if [[ $CIRCLE_PROJECT_USERNAME != "influxdata" ]]; then
104
+ echo "Nothing to do for forked repositories, so marking this step successful"
105
+ circleci step halt
106
+ fi
107
+ - checkout
108
+ - run:
109
+ name: Setup Rubygems
110
+ command: bash .circleci/setup-rubygems.sh
111
+ - run:
112
+ name: Build a Gem bundle
113
+ command: |
114
+ gem build fluent-plugin-influxdb-v2.gemspec
115
+ - run:
116
+ name: Deploy pre-release into https://rubygems.org
117
+ command: |
118
+ gem push fluent-plugin-influxdb-v2-*.pre.$CIRCLE_BUILD_NUM.gem
119
+ workflows:
120
+ version: 2
121
+ build:
122
+ jobs:
123
+ - tests-ruby:
124
+ name: ruby-2.7
125
+ ruby-image: "circleci/ruby:2.7-buster"
126
+ - tests-ruby:
127
+ name: ruby-2.6
128
+ - tests-ruby:
129
+ name: ruby-2.6-nightly
130
+ influxdb-image: "influx:nightly"
131
+ - tests-ruby:
132
+ name: ruby-2.5
133
+ ruby-image: "circleci/ruby:2.5-stretch"
134
+ - tests-ruby:
135
+ name: ruby-2.4
136
+ ruby-image: "circleci/ruby:2.4-stretch"
137
+ - deploy-preview:
138
+ requires:
139
+ - ruby-2.7
140
+ - ruby-2.6
141
+ - ruby-2.6-nightly
142
+ - ruby-2.5
143
+ - ruby-2.4
144
+ filters:
145
+ branches:
146
+ only: master
147
+
148
+ nightly:
149
+ triggers:
150
+ - schedule:
151
+ cron: "0 0 * * *"
152
+ filters:
153
+ branches:
154
+ only:
155
+ - master
156
+ jobs:
157
+ - tests-ruby
@@ -0,0 +1,3 @@
1
+ mkdir ~/.gem || true
2
+ echo -e "---\r\n:rubygems_api_key: $GEM_HOST_API_KEY" > ~/.gem/credentials
3
+ chmod 0600 ~/.gem/credentials
@@ -0,0 +1,8 @@
1
+ Closes #
2
+
3
+ _Briefly describe your proposed changes:_
4
+
5
+ - [ ] CHANGELOG.md updated
6
+ - [ ] Rebased/mergeable
7
+ - [ ] Tests pass
8
+ - [ ] Sign [CLA](https://influxdata.com/community/cla/) (if not already signed)
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.idea/
3
+ /.yardoc
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /Gemfile.lock
11
+ /test/reports/
12
+ .rakeTasks
13
+ **/fluent-plugin-influxdb-v2*.gem
14
+ /vendor/
@@ -0,0 +1,36 @@
1
+ #
2
+ # The MIT License
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #
22
+
23
+ Metrics/LineLength:
24
+ Max: 120
25
+ Metrics/MethodLength:
26
+ Max: 50
27
+ Metrics/ClassLength:
28
+ Max: 500
29
+ Metrics/AbcSize:
30
+ Max: 40
31
+ Metrics/BlockLength:
32
+ Max: 40
33
+ Metrics/CyclomaticComplexity:
34
+ Max: 15
35
+ Metrics/PerceivedComplexity:
36
+ Max: 15
@@ -0,0 +1,38 @@
1
+ ## 1.5.0 [2020-07-17]
2
+
3
+ 1. [#12](https://github.com/influxdata/influxdb-plugin-fluent/pull/12): Renamed gem to `fluent-plugin-influxdb-v2`
4
+
5
+ ### Dependencies
6
+ 1. [#11](https://github.com/influxdata/influxdb-plugin-fluent/pull/11): Upgrade InfluxDB client to 1.6.0
7
+
8
+ ## 1.4.0 [2020-06-19]
9
+
10
+ ### Features
11
+ 1. [#8](https://github.com/influxdata/influxdb-plugin-fluent/pull/8): Added support for nested fields
12
+
13
+ ### Dependencies
14
+ 1. [#9](https://github.com/influxdata/influxdb-plugin-fluent/pull/9): Upgrade InfluxDB client to 1.5.0
15
+
16
+ ## 1.3.0 [2020-05-15]
17
+
18
+ ### Dependencies
19
+ 1. [#6](https://github.com/influxdata/influxdb-plugin-fluent/pull/6): Upgrade InfluxDB client to 1.4.0
20
+
21
+ ## 1.2.0 [2020-03-13]
22
+
23
+ ### Security
24
+ 1. [#4](https://github.com/influxdata/influxdb-plugin-fluent/pull/4): Upgrade rake to version 12.3.3 - [CVE-2020-8130](https://github.com/advisories/GHSA-jppv-gw3r-w3q8)
25
+
26
+ ### Dependencies
27
+ 1. [#5](https://github.com/influxdata/influxdb-plugin-fluent/pull/5): Upgrade InfluxDB client
28
+
29
+ ## 1.1.0 [2020-02-14]
30
+
31
+ ### Dependencies
32
+ 1. [#1](https://github.com/influxdata/influxdb-plugin-fluent/pull/3): Update to stable version of InfluxDB client
33
+
34
+ ## 1.0.0 [2020-01-17]
35
+
36
+ ### Features
37
+ 1. [#1](https://github.com/influxdata/influxdb-plugin-fluent/pull/1): Initial version of buffered output plugin for InfluxDB 2
38
+
data/Gemfile ADDED
@@ -0,0 +1,24 @@
1
+ # The MIT License
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ # THE SOFTWARE.
20
+
21
+ source 'https://rubygems.org'
22
+
23
+ # Specify your gem's dependencies in fluent-plugin-influxdb-v2.gemspec
24
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Influxdata, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,113 @@
1
+ # influxdb-plugin-fluent
2
+
3
+ [![CircleCI](https://circleci.com/gh/influxdata/influxdb-plugin-fluent.svg?style=svg)](https://circleci.com/gh/influxdata/influxdb-plugin-fluent)
4
+ [![codecov](https://codecov.io/gh/influxdata/influxdb-plugin-fluent/branch/master/graph/badge.svg)](https://codecov.io/gh/influxdata/influxdb-plugin-fluent)
5
+ [![Gem Version](https://badge.fury.io/rb/fluent-plugin-influxdb-v2.svg)](https://badge.fury.io/rb/fluent-plugin-influxdb-v2)
6
+ [![License](https://img.shields.io/github/license/influxdata/influxdb-plugin-fluent.svg)](https://github.com/influxdata/influxdb-plugin-fluent/blob/master/LICENSE)
7
+ [![GitHub issues](https://img.shields.io/github/issues-raw/influxdata/influxdb-plugin-fluent.svg)](https://github.com/influxdata/influxdb-plugin-fluent/issues)
8
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/influxdata/influxdb-plugin-fluent.svg)](https://github.com/influxdata/influxdb-plugin-fluent/pulls)
9
+ [![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://www.influxdata.com/slack)
10
+
11
+ This repository contains the reference Fluentd plugin for the InfluxDB 2.0.
12
+
13
+ #### Note: This plugin is for use with InfluxDB 2.x. For InfluxDB 1.x instances, please use the [fluent-plugin-influxdb](https://github.com/fangli/fluent-plugin-influxdb) plugin.
14
+
15
+ ## Installation
16
+
17
+ ### Gems
18
+
19
+ The plugin is bundled as a gem and is hosted on [Rubygems](https://rubygems.org/gems/fluent-plugin-influxdb-v2). You can install the gem as follows:
20
+
21
+ ```
22
+ fluent-gem install fluent-plugin-influxdb-v2 -v 1.5.0
23
+ ```
24
+
25
+ ## Plugins
26
+
27
+ ### influxdb2
28
+
29
+ Store Fluentd event to InfluxDB 2 database.
30
+
31
+ #### Configuration
32
+
33
+ | Option | Description | Type | Default |
34
+ |---|---|---|---|
35
+ | url | InfluxDB URL to connect to (ex. https://localhost:9999). | String | https://localhost:9999 |
36
+ | token | Access Token used for authenticating/authorizing the InfluxDB request sent by client. | String | |
37
+ | use_ssl | Turn on/off SSL for HTTP communication. | bool | true |
38
+ | bucket | Specifies the destination bucket for writes. | String | |
39
+ | org | Specifies the destination organization for writes. | String | |
40
+ | measurement | The name of the measurement. If not specified, Fluentd's tag is used. | String | nil |
41
+ | tag_keys | The list of record keys that are stored in InfluxDB as 'tag'. | Array | [] |
42
+ | tag_fluentd | Specifies if the Fluentd's event tag is included into InfluxDB tags (ex. 'fluentd=system.logs'). | bool | false |
43
+ | field_keys | The list of record keys that are stored in InfluxDB as 'field'. If it's not specified than as fields are used all record keys. | Array | [] |
44
+ | field_cast_to_float | Turn on/off auto casting Integer value to Float. Helper to avoid mismatch error: 'series type mismatch: already Integer but got Float'. | bool | false |
45
+ | time_precision | The time precision of timestamp. You should specify either second (s), millisecond (ms), microsecond (us), or nanosecond (ns). | String | ns |
46
+ | time_key | A name of the record key that used as a 'timestamp' instead of event timestamp. If a record key doesn't exists or hasn't value then is used event timestamp. | String | nil |
47
+
48
+ ##### Minimal configuration
49
+
50
+ ```
51
+ <match influxdb2.**>
52
+ @type influxdb2
53
+
54
+ # InfluxDB URL to connect to (ex. https://localhost:9999).
55
+ url https://localhost:9999
56
+ # Access Token used for authenticating/authorizing the InfluxDB request sent by client.
57
+ token my-token
58
+
59
+ # Specifies the destination bucket for writes.
60
+ bucket my-bucket
61
+ # Specifies the destination organization for writes.
62
+ org my-org
63
+ </match>
64
+ ```
65
+
66
+ ##### Full configuration
67
+
68
+ ```
69
+ <match influxdb2.**>
70
+ @type influxdb2
71
+
72
+ # InfluxDB URL to connect to (ex. https://localhost:9999).
73
+ url https://localhost:9999
74
+ # Access Token used for authenticating/authorizing the InfluxDB request sent by client.
75
+ token my-token
76
+ # Turn on/off SSL for HTTP communication.
77
+ use_ssl true
78
+
79
+ # Specifies the destination bucket for writes.
80
+ bucket my-bucket
81
+ # Specifies the destination organization for writes.
82
+ org my-org
83
+
84
+ # The name of the measurement. If not specified, Fluentd's tag is used.
85
+ measurement h2o
86
+ # The list of record keys that are stored in InfluxDB as 'tag'.
87
+ tag_keys ["location", "type"]
88
+ # Specifies if the Fluentd's event tag is included into InfluxDB tags (ex. 'fluentd=system.logs).'
89
+ tag_fluentd true
90
+
91
+ # The list of record keys that are stored in InfluxDB as 'field'.
92
+ # If it's not specified than as fields are used all record keys.
93
+ field_keys ["value"]
94
+ # Turn on/off auto casting Integer value to Float.
95
+ # Helper to avoid mismatch error: 'series type mismatch: already Integer but got Float'.
96
+ field_cast_to_float true
97
+
98
+ # The time precision of timestamp. You should specify either second (s), millisecond (ms),
99
+ # microsecond (us), or nanosecond (ns).
100
+ time_precision s
101
+ # A name of the record key that used as a 'timestamp' instead of event timestamp.
102
+ # If a record key doesn't exists or hasn't value then is used event timestamp.
103
+ time_key time
104
+ </match>
105
+ ```
106
+
107
+ ## Contributing
108
+
109
+ Bug reports and pull requests are welcome on GitHub at https://github.com/influxdata/influxdb-plugin-fluent.
110
+
111
+ ## License
112
+
113
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,37 @@
1
+ # The MIT License
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ # THE SOFTWARE.
20
+
21
+ require 'bundler/gem_tasks'
22
+ require 'rake/testtask'
23
+ require 'rubocop/rake_task'
24
+
25
+ Rake::TestTask.new(:test) do |t|
26
+ t.libs << 'test'
27
+ t.libs << 'lib'
28
+ t.test_files = FileList['test/**/*_test.rb']
29
+ end
30
+
31
+ task default: :test
32
+
33
+ # Rubocop
34
+ desc 'Run Rubocop lint checks'
35
+ task :rubocop do
36
+ RuboCop::RakeTask.new
37
+ end