nat.observability.exporter.file_exporter#
Attributes#
Classes#
A File exporter that exports telemetry traces to a local file. |
Module Contents#
- logger#
- class FileExporter(
- context_state: nat.builder.context.ContextState | None = None,
- **file_kwargs,
Bases:
nat.observability.mixin.file_mixin.FileExportMixin
,nat.observability.exporter.raw_exporter.RawExporter
[nat.data_models.intermediate_step.IntermediateStep
,str
]A File exporter that exports telemetry traces to a local file.
Initialize the file exporter with the specified output_path and project.
- Args:
output_path (str): The path to the output file or directory (if rolling enabled). project (str): The project name for metadata. mode (str): Either “append” or “overwrite”. Defaults to “append”. enable_rolling (bool): Enable rolling log files. Defaults to False. max_file_size (int): Maximum file size in bytes before rolling. Defaults to 10MB. max_files (int): Maximum number of rolled files to keep. Defaults to 5. cleanup_on_init (bool): Clean up old files during initialization. Defaults to False.
- Raises:
- ResourceConflictError: If another FileExportMixin instance is already using
the same file path or would create conflicting files.
- _processor#