nat.plugins.data_flywheel.observability.mixin.elasticsearch_mixin#

Attributes#

Classes#

ElasticsearchMixin

Mixin for elasticsearch exporters.

Module Contents#

logger#
class ElasticsearchMixin(
*args,
endpoint: str,
index: str,
elasticsearch_auth: tuple[str, str],
headers: dict[str, str] | None = None,
**kwargs,
)#

Mixin for elasticsearch exporters.

This mixin provides elasticsearch-specific functionality for SpanExporter exporters. It handles elasticsearch-specific resource tagging and uses the AsyncElasticsearch client.

Initialize the elasticsearch exporter.

Args:

endpoint (str): The elasticsearch endpoint. index (str): The elasticsearch index. elasticsearch_auth (tuple[str, str]): The elasticsearch authentication credentials. headers (dict[str, str] | None): The elasticsearch headers.

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

Export a batch of spans.

Args:

item (dict | list[dict]): Dictionary or list of dictionaries to export to Elasticsearch.