fluent-plugin-cloudwatch-ingest 1.3.0 → 1.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e71179fd143c24d2f1e0c41e5368b93f69ab9ee2
4
- data.tar.gz: 7f5f859479b39059a3fb5086fdfa1cb79193d828
3
+ metadata.gz: 852a0773b4fd72b1ca24faebd4624b5732d3d916
4
+ data.tar.gz: 9815dd011589740f0af019e450ff1def0682f11a
5
5
  SHA512:
6
- metadata.gz: 8f036ac6cc92eaa5762986352b03a339a498fe8de4690e1b48572d7a0232ef2975f75eb34b6a605b7e9fed510dae0225d7454ca228c4e0e20e8faec2d2538a36
7
- data.tar.gz: 74823d37c5ee4a19d71d40bcfe496a3a399e01b700bc9129c5c83512e3529f3a643da6ff4e037d08c310641aba0c71d30d299af0892889903ed2c77353be807c
6
+ metadata.gz: 10ab86bf0fde33eb65869c2db408a3a9bc1658807d4d3e6e8e5b7bd35e9f68f81c4e5a2270dc636e7dbadb3bd306dd9f39c683eba7eb05d9b2b8149df3415845
7
+ data.tar.gz: 2998fe65f16a65b8582fb6b2ec0ca4b0e3ad20262e229d8f0140cd5bfb7d68bbd93b4c72ad00712ffc8f075db7cae32bc968e82dac2d910fee9f72375015574d
data/CHANGELOG.md CHANGED
@@ -47,3 +47,13 @@
47
47
  * Add telemetry to the parser
48
48
 
49
49
  Both of these changes are designed to make debugging ingestion problems from high-volume log groups easier.
50
+
51
+ ## 1.3.0
52
+
53
+ * Add `log_group_exclude_regexp` to allow optional exclusion of log groups by regexp
54
+
55
+ ## 1.4.0
56
+
57
+ * Refuse to emit records with a blank (or newline only) message
58
+ * Emit metric `events.emitted.blocked` to expose these alongside logging
59
+ * Add plugin skew time to telemetry optionally emitted from the parser
data/README.md CHANGED
@@ -44,6 +44,7 @@ Or install it yourself as:
44
44
  limit_events 10000 # Number of events to fetch in any given iteration
45
45
  event_start_time 0 # Do not fetch events before this time (UNIX epoch, miliseconds)
46
46
  oldest_logs_first false # When true fetch the oldest logs first
47
+ drop_blank_events true # Fluentd may throw an exception if a blank event is emitted
47
48
  telemetry false # Produce statsd telemetry
48
49
  statsd_endpoint localhost # Endpoint to which telemetry should be sent
49
50
  <parse>
@@ -106,6 +107,7 @@ api.calls.getlogevents.attempted
106
107
  api.calls.getlogevents.failed
107
108
  api.calls.getlogevents.invalid_token
108
109
  events.emitted.success
110
+ events.emitted.blocked
109
111
  ```
110
112
 
111
113
  Likewise when telemetry is enabled for the parser, the emitted metrics are:
@@ -116,6 +118,7 @@ parser.record.success
116
118
  parser.json.success # if json parsing is enabled
117
119
  parser.json.failed # if json parsing is enabled
118
120
  parser.ingestion_skew # the difference between `timestamp` and `ingestion_time` as returned by the Cloudwatch API
121
+ parser.plugin_skew # the difference between "now" and `timestamp`
119
122
  ```
120
123
 
121
124
  ### Sub-second timestamps
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Ingest
5
- VERSION = '1.3.0'.freeze
5
+ VERSION = '1.4.0'.freeze
6
6
  end
7
7
  end
8
8
  end
@@ -43,6 +43,8 @@ module Fluent::Plugin
43
43
  config_param :event_start_time, :integer, default: 0
44
44
  desc 'Fetch the oldest logs first'
45
45
  config_param :oldest_logs_first, :bool, default: false
46
+ desc 'Refuse to emit events with a blank "message" field'
47
+ config_param :drop_blank_events, :bool, default: true
46
48
  desc 'Turn on telemetry'
47
49
  config_param :telemetry, :bool, default: false
48
50
  desc 'Statsd endpoint to which telemetry should be written'
@@ -136,6 +138,11 @@ module Fluent::Plugin
136
138
 
137
139
  def emit(event, log_group_name, log_stream_name)
138
140
  @parser.parse(event, log_group_name, log_stream_name) do |time, record|
141
+ if record['message'].chomp.empty? && @drop_blank_events
142
+ log.warn("Event is blank or contains only a newline, refusing to emit. group: #{log_group_name}, stream: #{log_stream_name}, event: #{event}") # rubocop:disable LineLength
143
+ metric(:increment, 'events.emitted.blocked')
144
+ next
145
+ end
139
146
  router.emit(@tag, time, record)
140
147
  metric(:increment, 'events.emitted.success')
141
148
  end
@@ -94,6 +94,15 @@ module Fluent
94
94
  )
95
95
  end
96
96
 
97
+ # Optionally emit @timestamp and plugin ingestion time skew
98
+ if @telemetry
99
+ metric(
100
+ :gauge,
101
+ 'parser.plugin_skew',
102
+ now.strftime('%Q').to_i - event.timestamp
103
+ )
104
+ end
105
+
97
106
  # We do String processing on the event time here to
98
107
  # avoid rounding errors introduced by floating point
99
108
  # arithmetic.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-ingest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pointer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-20 00:00:00.000000000 Z
11
+ date: 2017-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler