pub struct Builder<F = NestedFmt, A = fn() -> Result<TcpStream>> { /* private fields */ }
Expand description

Builder to enable forwarding tracing events towards the fluentd server.

Type params

  • F - Attributes formatter, determines how to compose fluent::Record.
  • A - function that returns Fluentd wrter. Default is to create tcp socket towards 127.0.0.1:24224 with timeout of 1s.

Implementations

Creates default configuration.

Params:

tag - Event category to send for each record.

Configures to flatten span/metadata attributes within record. Instead of the default nesting behavior.

Provides callback to get writer where to write records.

Normally fluentd server expects connection to be closed immediately upon sending records. hence created writer is dropped immediately upon writing being finished.

Provides callback to get writer where to write records.

Normally fluentd server expects connection to be closed immediately upon sending records. hence created writer is dropped immediately upon writing being finished.

Creates tracing layer.

If you do not want to create multiple threads, consider using layer_guarded/layer_from_guard.

Error can happen during creation of worker thread.

Creates tracing layer, returning guard that allows to stop fluentd worker on Drop.

This may be necessary due to bad API that tracing provides to control lifetime of global logger. As underlying implementations employs caching, it needs to perform flush once logger is no longer necessary hence this API is provided.

Error can happen during creation of worker thread.

Creates tracing layer, using guard returned by layer_guarded.

Specifically, it will use the same worker thread as first instance of layer_guarded, without affecting lifetime of guard. Hence once guard is dropped, worker for all connected layers will stop sending logs.

Error can happen during creation of worker thread.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more