Skip to content

Commit

Permalink
FIX: don't ignore the pipeline in ElasticSearch bulk_write
Browse files Browse the repository at this point in the history
  • Loading branch information
emam-kpn authored and eigenein committed Feb 8, 2023
1 parent 17473f7 commit 92749fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion time_execution/backends/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def bulk_write(self, metrics):
for metric in metrics:
actions.append({"index": {"_index": index}})
actions.append(metric)

bulk_params = {"operations": actions}
if self.pipeline:
bulk_params["pipeline"] = self.pipeline

try:
self.client.bulk(operations=actions)
self.client.bulk(**bulk_params)
except TransportError as exc:
logger.warning("bulk_write metrics %r failure %r", metrics, exc)

0 comments on commit 92749fb

Please sign in to comment.