Class: Fluent::DatadogOutput::DatadogClient
- Inherits:
-
Object
- Object
- Fluent::DatadogOutput::DatadogClient
show all
- Defined in:
- lib/fluent/plugin/out_datadog.rb
Overview
Top level class for datadog transport clients, managing retries and backoff
Instance Method Summary
collapse
Instance Method Details
#close ⇒ Object
297
298
299
|
# File 'lib/fluent/plugin/out_datadog.rb', line 297
def close
raise NotImplementedError, "Datadog transport client should implement the close method"
end
|
#send(payload) ⇒ Object
293
294
295
|
# File 'lib/fluent/plugin/out_datadog.rb', line 293
def send(payload)
raise NotImplementedError, "Datadog transport client should implement the send method"
end
|
#send_retries(payload, max_retries, max_backoff) ⇒ Object
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
# File 'lib/fluent/plugin/out_datadog.rb', line 277
def send_retries(payload, max_retries, max_backoff)
backoff = 1
retries = 0
begin
send(payload)
rescue RetryableError => e
if retries < max_retries || max_retries < 0
@logger.warn("Retrying ", :exception => e, :backtrace => e.backtrace)
sleep backoff
backoff = 2 * backoff unless backoff > max_backoff
retries += 1
retry
end
end
end
|