nat.observability.register#

Attributes#

Classes#

FileTelemetryExporterConfig

A telemetry exporter that writes runtime traces to local files with optional rolling.

ConsoleLoggingMethodConfig

A logger to write runtime logs to the console.

FileLoggingMethod

A logger to write runtime logs to a file.

Functions#

file_telemetry_exporter(config, builder)

Build and return a FileExporter for file-based telemetry export with optional rolling.

console_logging_method(config, builder)

Build and return a StreamHandler for console-based logging.

file_logging_method(config, builder)

Build and return a FileHandler for file-based logging.

Module Contents#

logger#
class FileTelemetryExporterConfig(/, **data: Any)#

Bases: nat.data_models.telemetry_exporter.TelemetryExporterBaseConfig

A telemetry exporter that writes runtime traces to local files with optional rolling.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

output_path: str = None#
project: str = None#
mode: nat.observability.mixin.file_mode.FileMode = None#
enable_rolling: bool = None#
max_file_size: int = None#
max_files: int = None#
cleanup_on_init: bool = None#
async file_telemetry_exporter(
config: FileTelemetryExporterConfig,
builder: nat.builder.builder.Builder,
)#

Build and return a FileExporter for file-based telemetry export with optional rolling.

class ConsoleLoggingMethodConfig(/, **data: Any)#

Bases: nat.data_models.logging.LoggingBaseConfig

A logger to write runtime logs to the console.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

level: str = None#
async console_logging_method(
config: ConsoleLoggingMethodConfig,
builder: nat.builder.builder.Builder,
)#

Build and return a StreamHandler for console-based logging.

class FileLoggingMethod(/, **data: Any)#

Bases: nat.data_models.logging.LoggingBaseConfig

A logger to write runtime logs to a file.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

path: str = None#
level: str = None#
async file_logging_method(
config: FileLoggingMethod,
builder: nat.builder.builder.Builder,
)#

Build and return a FileHandler for file-based logging.