fluent-plugin-oci-logging 1.0.6 → 1.0.12

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: acd2223390cb0837861ca6d0ff70acdaea1b44456538e784446a57834102d40b
4
- data.tar.gz: 7a2b84a24ab9940f585304f6648ad9176ba366cec38c3af671c629556a219e83
3
+ metadata.gz: 8da08ff601b50140201c74c6b8fc5a15da8f25288315ceee1b42382e5a051d55
4
+ data.tar.gz: 37e3601768a8b5eee329b72775683a18afe50c90f9c2741d3a0aa2d6ae4d3f93
5
5
  SHA512:
6
- metadata.gz: 8e547e8e77256c9c605998a7ea2c8200e1a5f8d3ff9667d9752ea76ef1d15450b1c65d9a40302fabe4a92d6c2426e85581733842222f4bbf332e33ce05c55bf1
7
- data.tar.gz: 1dcbeffec6efb01771b751e583a0a231bfdb48ddb29c0c94f5ada13862a4f7a2b9764734bdcb076e256286fed3dcebb4a88664fe4601ab3cdc3275dabd6ee7d5
6
+ metadata.gz: '0293f60930bf42b4fed3411ba74dd9389e8d8138d9ee512ae09c8b00c55e57b96c8a3c0e9c2b1fc59ff83e8daff49239d5ba1f592a10721a2c350db624ced0a9'
7
+ data.tar.gz: 433fe08996fcbd80888fdb476acb5d904eda926f08d5cfd98e12bf454fd337ae87b1efa3b991ee9eec2f921e6e0f866322d8133d3eceec696c9e7f34315d8813
@@ -42,6 +42,8 @@ module Fluent
42
42
 
43
43
  helpers :event_emitter
44
44
 
45
+ PAYLOAD_SIZE = 9*1024*1024 #restricting payload size at 9MB
46
+
45
47
  def configure(conf)
46
48
  super
47
49
  log.debug 'determining the signer type'
@@ -73,19 +75,30 @@ module Fluent
73
75
  log.debug "writing chunk metadata #{chunk.metadata}", \
74
76
  dump_unique_id_hex(chunk.unique_id)
75
77
  log_batches_map = {}
76
-
77
- # For standard chunk format (without #format() method)
78
+ # For standard chunk format (without #format() method)
79
+ size = 0
78
80
  chunk.each do |time, record|
79
81
  begin
80
82
  tag = get_modified_tag(chunk.metadata.tag)
81
83
  source_identifier = record.key?('tailed_path') ? record['tailed_path'] : ''
84
+ content = flatten_hash(record)
85
+ size += content.to_json.bytesize
82
86
  build_request(time, record, tag, log_batches_map, source_identifier)
87
+ if size >= PAYLOAD_SIZE
88
+ log.info "Exceeding payload size. Size : #{size}"
89
+ send_requests(log_batches_map)
90
+ log_batches_map = {}
91
+ size = 0
92
+ end
83
93
  rescue StandardError => e
84
94
  log.error(e.full_message)
85
95
  end
86
96
  end
87
-
88
- send_requests(log_batches_map) # flush data
97
+ # flushing data to LJ
98
+ unless log_batches_map.empty?
99
+ log.info "Payload size : #{size}"
100
+ send_requests(log_batches_map)
101
+ end
89
102
  end
90
103
  end
91
104
  end
data/lib/version.rb CHANGED
@@ -17,6 +17,6 @@ end
17
17
  module OCILogging
18
18
  MAJOR=1
19
19
  MINOR=0
20
- PATCH=6
20
+ PATCH=number_of_commits
21
21
  VERSION = ENV['OCI_LOGGING_GEM_VERSION'] || "#{MAJOR}.#{MINOR}.#{PATCH}"
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-oci-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - OCI Observability Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2022-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  requirements: []
189
- rubygems_version: 3.2.31
189
+ rubygems_version: 3.0.3
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: OCI Fluentd Logging output plugin following Unified Schema