fluent-plugin-scalyr 0.8.9 → 0.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +10 -5
- data/VERSION +1 -1
- data/fluent-plugin-scalyr.gemspec +0 -1
- data/fluent.conf.sample +1 -1
- data/lib/fluent/plugin/out_scalyr.rb +8 -24
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 607dd0cf45280387ab9c19b460eab081f2111b1059f8036032e13c1c5c4fd901
|
4
|
+
data.tar.gz: 3d0fa711e084ce2f204dbf69c249363a88d73293a6874c8eb6a175ee920e5cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6075b808c1126d4b4d8ba7ea30fb5d899facc78c38f4d0d95afc8c97f5eca8f28aefdf414b267dd45695ebe70feb2dd976be76babb8f8458d1240382077a3f0
|
7
|
+
data.tar.gz: deeafb8a4886f51ce635541756e33ba5c3a98b31e6c4ac6f0a5a37a9f8f8862e2a32d0be2026d90f6f7828157e43ac77261529364f1b2bf697b9a2948f7fd3e4
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Scalyr output plugin for Fluentd
|
2
|
-
|
2
|
+
================================
|
3
3
|
|
4
4
|
**Note:** Fluentd introduced breaking changes to their plugin API between
|
5
5
|
version 0.12 and 0.14.
|
@@ -24,7 +24,7 @@ Fluentd may format log messages into json or some other format. If you want to
|
|
24
24
|
format none
|
25
25
|
```
|
26
26
|
|
27
|
-
The Scalyr output plugin assigns a unique Scalyr session id for each Fluentd <match> block. It is recommended that a single machine doesn't create too many simultaneous Scalyr sessions, so if possible you should try to have a single match for all logs you wish to send to Scalyr.
|
27
|
+
The Scalyr output plugin assigns a unique Scalyr session id for each Fluentd <match> block, or for each worker. It is recommended that a single machine doesn't create too many simultaneous Scalyr sessions, so if possible you should try to have a single match for all logs you wish to send to Scalyr.
|
28
28
|
|
29
29
|
This can be done by specifying tags such as scalyr.apache, scalyr.maillog etc and matching on scalyr.\*
|
30
30
|
|
@@ -66,7 +66,8 @@ The following configuration options are also supported:
|
|
66
66
|
|
67
67
|
#scalyr specific options
|
68
68
|
api_write_token YOUR_SCALYR_WRITE_TOKEN
|
69
|
-
compression_type
|
69
|
+
compression_type deflate
|
70
|
+
compression_level 6
|
70
71
|
use_hostname_for_serverhost true
|
71
72
|
server_attributes {
|
72
73
|
"serverHost": "front-1",
|
@@ -80,7 +81,7 @@ The following configuration options are also supported:
|
|
80
81
|
ssl_verify_depth 5
|
81
82
|
message_field message
|
82
83
|
|
83
|
-
max_request_buffer
|
84
|
+
max_request_buffer 5500000
|
84
85
|
|
85
86
|
force_message_encoding nil
|
86
87
|
replace_invalid_utf8 false
|
@@ -99,6 +100,10 @@ The following configuration options are also supported:
|
|
99
100
|
</match>
|
100
101
|
```
|
101
102
|
|
103
|
+
For some additional examples of configuration for different setups, please refer to the
|
104
|
+
[examples/configs/](https://github.com/scalyr/scalyr-fluentd/tree/master/examples/configs/)
|
105
|
+
directory.
|
106
|
+
|
102
107
|
### Scalyr specific options
|
103
108
|
|
104
109
|
***compression_type*** - compress Scalyr traffic to reduce network traffic. Options are `bz2` and `deflate`. See [here](https://www.scalyr.com/help/scalyr-agent#compressing) for more details. This feature is optional.
|
@@ -129,7 +134,7 @@ The cURL project maintains CA certificate bundles automatically converted from m
|
|
129
134
|
|
130
135
|
***message_field*** - Scalyr expects all log events to have a 'message' field containing the contents of a log message. If your event has the log message stored in another field, you can specify the field name here, and the plugin will rename that field to 'message' before sending the data to Scalyr. **Note:** this will override any existing 'message' field if the log record contains both a 'message' field and the field specified by this config option.
|
131
136
|
|
132
|
-
***max_request_buffer*** - The maximum size in bytes of each request to send to Scalyr. Defaults to
|
137
|
+
***max_request_buffer*** - The maximum size in bytes of each request to send to Scalyr. Defaults to 5,500,000 (5.5MB). Fluentd chunks that generate JSON requests larger than the max_request_buffer will be split in to multiple separate requests. **Note:** The maximum size the Scalyr servers accept for this value is 6MB and requests containing data larger than this will be rejected.
|
133
138
|
|
134
139
|
***force_message_encoding*** - Set a specific encoding for all your log messages (defaults to nil). If your log messages are not in UTF-8, this can cause problems when converting the message to JSON in order to send to the Scalyr server. You can avoid these problems by setting an encoding for your log messages so they can be correctly converted.
|
135
140
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.10
|
@@ -9,7 +9,6 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.authors = ["Imron Alston"]
|
10
10
|
gem.licenses = ["Apache-2.0"]
|
11
11
|
gem.email = "imron@scalyr.com"
|
12
|
-
gem.has_rdoc = false
|
13
12
|
gem.platform = Gem::Platform::RUBY
|
14
13
|
gem.files = Dir['AUTHORS', 'Gemfile', 'LICENSE', 'README.md', 'Rakefile', 'VERSION', 'fluent-plugin-scalyr.gemspec', 'fluent.conf.sample', 'lib/**/*', 'test/**/*']
|
15
14
|
gem.test_files = Dir.glob("{test,spec,features}/**/*")
|
data/fluent.conf.sample
CHANGED
@@ -43,11 +43,11 @@ module Scalyr
|
|
43
43
|
config_param :ssl_verify_peer, :bool, :default => true
|
44
44
|
config_param :ssl_verify_depth, :integer, :default => 5
|
45
45
|
config_param :message_field, :string, :default => "message"
|
46
|
-
config_param :max_request_buffer, :integer, :default =>
|
46
|
+
config_param :max_request_buffer, :integer, :default => 5500000
|
47
47
|
config_param :force_message_encoding, :string, :default => nil
|
48
48
|
config_param :replace_invalid_utf8, :bool, :default => false
|
49
49
|
config_param :compression_type, :string, :default => nil #Valid options are bz2, deflate or None. Defaults to None.
|
50
|
-
config_param :compression_level, :integer, :default =>
|
50
|
+
config_param :compression_level, :integer, :default => 6 #An int containing the compression level of compression to use, from 1-9. Defaults to 6
|
51
51
|
|
52
52
|
config_section :buffer do
|
53
53
|
config_set_default :retry_max_times, 40 #try a maximum of 40 times before discarding
|
@@ -67,6 +67,10 @@ module Scalyr
|
|
67
67
|
true
|
68
68
|
end
|
69
69
|
|
70
|
+
def multi_workers_ready?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
70
74
|
def configure( conf )
|
71
75
|
|
72
76
|
if conf.elements('buffer').empty?
|
@@ -139,15 +143,10 @@ module Scalyr
|
|
139
143
|
|
140
144
|
def start
|
141
145
|
super
|
142
|
-
$log.info "Scalyr Fluentd Plugin ID - #{self.plugin_id()}"
|
143
146
|
#Generate a session id. This will be called once for each <match> in fluent.conf that uses scalyr
|
144
147
|
@session = SecureRandom.uuid
|
145
148
|
|
146
|
-
|
147
|
-
#the following variables are all under the control of the above mutex
|
148
|
-
@thread_ids = Hash.new #hash of tags -> id
|
149
|
-
@next_id = 1 #incrementing thread id for the session
|
150
|
-
@last_timestamp = 0 #timestamp of most recent event in nanoseconds since epoch
|
149
|
+
$log.info "Scalyr Fluentd Plugin ID id=#{self.plugin_id()} worker=#{fluentd_worker_id} session=#{@session}"
|
151
150
|
|
152
151
|
end
|
153
152
|
|
@@ -334,22 +333,7 @@ module Scalyr
|
|
334
333
|
|
335
334
|
timestamp = self.to_nanos( sec, nsec )
|
336
335
|
|
337
|
-
thread_id =
|
338
|
-
|
339
|
-
@sync.synchronize {
|
340
|
-
#ensure timestamp is at least 1 nanosecond greater than the last one
|
341
|
-
timestamp = [timestamp, @last_timestamp + 1].max
|
342
|
-
@last_timestamp = timestamp
|
343
|
-
|
344
|
-
#get thread id or add a new one if we haven't seen this tag before
|
345
|
-
if @thread_ids.key? tag
|
346
|
-
thread_id = @thread_ids[tag]
|
347
|
-
else
|
348
|
-
thread_id = @next_id
|
349
|
-
@thread_ids[tag] = thread_id
|
350
|
-
@next_id += 1
|
351
|
-
end
|
352
|
-
}
|
336
|
+
thread_id = tag
|
353
337
|
|
354
338
|
#then update the map of threads for this chunk
|
355
339
|
current_threads[tag] = thread_id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-scalyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Imron Alston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -168,14 +168,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
|
172
|
-
rubygems_version: 2.6.10
|
171
|
+
rubygems_version: 3.0.6
|
173
172
|
signing_key:
|
174
173
|
specification_version: 4
|
175
174
|
summary: Scalyr plugin for fluentd
|
176
175
|
test_files:
|
177
|
-
- test/helper.rb
|
178
|
-
- test/test_ssl_verify.rb
|
179
176
|
- test/test_handle_response.rb
|
180
|
-
- test/
|
177
|
+
- test/test_ssl_verify.rb
|
181
178
|
- test/test_config.rb
|
179
|
+
- test/test_events.rb
|
180
|
+
- test/helper.rb
|