Class: OpenTelemetry::SDK::Logs::LogRecordProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/sdk/logs/log_record_processor.rb

Overview

LogRecordProcessor describes a duck type and provides a synchronous no-op hook for when a LogRecord is emitted. It is not required to subclass this class to provide an implementation of LogRecordProcessor, provided the interface is satisfied.

Instance Method Summary collapse

Instance Method Details

#force_flush(timeout: nil) ⇒ Integer

Export all log records to the configured Exporter that have not yet been exported.

This method should only be called in cases where it is absolutely necessary, such as when using some FaaS providers that may suspend the process after an invocation, but before the Processor exports the completed spans.

Parameters:

  • timeout (optional Numeric) (defaults to: nil)

    An optional timeout in seconds.

Returns:

  • (Integer)

    Export::SUCCESS if no error occurred, Export::FAILURE if a non-specific failure occurred, Export::TIMEOUT if a timeout occurred.



32
33
34
# File 'lib/opentelemetry/sdk/logs/log_record_processor.rb', line 32

def force_flush(timeout: nil)
  Export::SUCCESS
end

#on_emit(log_record, context) ⇒ Object

Called when a OpenTelemetry::SDK::Logs::LogRecord is emitted. Subsequent calls are not permitted after shutdown is called.

Parameters:



19
# File 'lib/opentelemetry/sdk/logs/log_record_processor.rb', line 19

def on_emit(log_record, context); end

#shutdown(timeout: nil) ⇒ Integer

Parameters:

  • timeout (optional Numeric) (defaults to: nil)

    An optional timeout in seconds.

Returns:

  • (Integer)

    Export::SUCCESS if no error occurred, Export::FAILURE if a non-specific failure occurred, Export::TIMEOUT if a timeout occurred.



41
42
43
# File 'lib/opentelemetry/sdk/logs/log_record_processor.rb', line 41

def shutdown(timeout: nil)
  Export::SUCCESS
end