fluent-plugin-newrelic 1.2.1 → 1.2.3

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: 11df01d6cf7ef5b768dabccfc1d57f0aa7bf3bbd96010ab0d9109b0dae65434e
4
- data.tar.gz: bd8b44e862c08b809fb7ad08913d679dca2ff13d3029dca8c6c31656fa317676
3
+ metadata.gz: d4be95038976a5e5e708c6fdc9d733a7293aaf63461fb67378f953cc093df633
4
+ data.tar.gz: 9cc28ceaa43fbaf330c631a2614ba911802bf442ac540b27b2ff23d58cadab2c
5
5
  SHA512:
6
- metadata.gz: 2f5b0a413c051418c0635352cac3bbac7b039c00c4fef14d694cd3a531111e07f85dc9f44d87641b774cc00869a51574e161644b3fc3392c257284e0342aeead
7
- data.tar.gz: b8da217e0801af5053fad0539680348e5e94eeec56ddf4a67872c63afd968c53647ba2cde5b98424392b2104675298ee62a29e74bbc41d5790a0aad9911c23b7
6
+ metadata.gz: 27e2a425b516c5570c81b9680f1357e5fe27f9f9ebcbf885eeee6f30bd8402cc8d962b0fad3a7984a83e0528e1e17213a56421ccbeb83000408b122bbae52ac0
7
+ data.tar.gz: 6bc8cab7df418903885686e1da65f8de0e0704061af18f6fcf389d88b40be9eeed9bd48d55372c1ffac109f38c8633013541dedeb2b8bd2384922411dca7e810
@@ -8,7 +8,7 @@ on:
8
8
  jobs:
9
9
  ci:
10
10
  name: Continuous Delivery pipeline
11
- runs-on: ubuntu-18.04
11
+ runs-on: ubuntu-20.04
12
12
 
13
13
  steps:
14
14
  - name: Checkout code
@@ -5,7 +5,7 @@ on: [pull_request]
5
5
  jobs:
6
6
  ci:
7
7
  name: Continuous Integration pipeline
8
- runs-on: ubuntu-18.04
8
+ runs-on: ubuntu-20.04
9
9
 
10
10
  steps:
11
11
  - name: Checkout code
@@ -21,8 +21,7 @@ jobs:
21
21
  run: bundle exec rake
22
22
 
23
23
  - name: Publish Unit Test Results
24
- uses: EnricoMi/publish-unit-test-result-action@v1.5
24
+ uses: EnricoMi/publish-unit-test-result-action@v1.19
25
25
  if: always()
26
26
  with:
27
- github_token: ${{ secrets.GITHUB_TOKEN }}
28
- files: '**/TEST-*.xml'
27
+ files: '**/TEST-*.xml'
@@ -75,11 +75,8 @@ module Fluent
75
75
  end
76
76
 
77
77
  def package_record(record, timestamp)
78
- if defined? timestamp.nsec
79
- timestamp = timestamp * 1000 + timestamp.nsec / 1_000_000
80
- end
81
78
  packaged = {
82
- 'timestamp' => timestamp,
79
+ 'timestamp' => resolveTimestamp(record['timestamp'], timestamp),
83
80
  # non-intrinsic attributes get put into 'attributes'
84
81
  'attributes' => record
85
82
  }
@@ -141,6 +138,7 @@ module Fluent
141
138
  return [compressed_payload]
142
139
  end
143
140
 
141
+ compressed_payload_bytesize = compressed_payload.bytesize
144
142
  compressed_payload = nil # Free for GC
145
143
 
146
144
  if logs.length > 1 # we can split
@@ -150,7 +148,8 @@ module Fluent
150
148
  second_half = get_compressed_payloads(logs.slice(midpoint, logs.length))
151
149
  return first_half + second_half
152
150
  else
153
- log.error("Can't compress record below required maximum packet size and it will be discarded. Record: #{logs[0]}")
151
+ log.error("Can't compress record below required maximum packet size and it will be discarded. " +
152
+ "Record timestamp: #{logs[0]['timestamp']}. Compressed size: #{compressed_payload_bytesize} bytes. Uncompressed size: #{payload.to_json.bytesize} bytes.")
154
153
  return []
155
154
  end
156
155
  end
@@ -181,6 +180,17 @@ module Fluent
181
180
  gzip.close
182
181
  io.string
183
182
  end
183
+
184
+ def resolveTimestamp(recordTimestamp, fluentdTimestamp)
185
+ if recordTimestamp
186
+ recordTimestamp
187
+ else
188
+ if defined? fluentdTimestamp.nsec
189
+ fluentdTimestamp = fluentdTimestamp * 1000 + fluentdTimestamp.nsec / 1_000_000
190
+ end
191
+ fluentdTimestamp
192
+ end
193
+ end
184
194
  end
185
195
  end
186
196
  end
@@ -1,3 +1,3 @@
1
1
  module NewrelicFluentdOutput
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-newrelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - New Relic Logging Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-30 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd