observability.exporter.dfw_elasticsearch_exporter#

Classes#

DFWElasticsearchExporter

Elasticsearch-specific Data Flywheel exporter.

Module Contents#

class DFWElasticsearchExporter(
context_state: nat.builder.context.ContextState | None = None,
client_id: str = 'default',
contract_version: nat.plugins.data_flywheel.observability.schema.sink.elasticsearch.ContractVersion = ContractVersion.V1_1,
batch_size: int = 100,
flush_interval: float = 5.0,
max_queue_size: int = 1000,
drop_on_overflow: bool = False,
shutdown_timeout: float = 10.0,
**elasticsearch_kwargs,
)#

Bases: nat.plugins.data_flywheel.observability.mixin.elasticsearch_mixin.ElasticsearchMixin, nat.plugins.data_flywheel.observability.exporter.dfw_exporter.DFWExporter

Elasticsearch-specific Data Flywheel exporter.

Initialize the Elasticsearch Data Flywheel exporter.

Args:

context_state: The context state to use for the exporter. client_id: The client ID for the exporter. contract_version: The contract version to use for the exporter. batch_size: The batch size for exporting spans. flush_interval: The flush interval in seconds for exporting spans. max_queue_size: The maximum queue size for exporting spans. drop_on_overflow: Whether to drop spans on overflow. shutdown_timeout: The shutdown timeout in seconds. elasticsearch_kwargs: Additional arguments for ElasticsearchMixin: - endpoint: The elasticsearch endpoint. - index: The elasticsearch index name. - elasticsearch_auth: The elasticsearch authentication credentials. - headers: The elasticsearch headers.

contract_version#
async export_processed(item: dict | list[dict]) None#

Export processed DFW records to Elasticsearch.

Delegates to ElasticsearchMixin.export_processed() which handles bulk operations for lists and single document indexing for individual records.

Args:

item (dict | list[dict]): Single dictionary or batch of dictionaries to export