Skip to content

Commit

Permalink
elasticsearch: fix prom query syntax
Browse files Browse the repository at this point in the history
Error was spicerack.prometheus.PrometheusError: Unable to get metric: HTTP 400: {"status":"error","errorType":"bad_data","error":"parse error at char 28: unexpected left brace '{'"}

Fix was to switch query from using {{ to using {

Change-Id: I9de09dc4f8bdc10d334e0df20ea45711d2c5510d
  • Loading branch information
ryankemper committed Aug 31, 2020
1 parent a0728be commit c1ca7ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spicerack/elasticsearch_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ def wait_for_all_write_queues_empty(self) -> None:
# We expect all DCs except one to return empty results, but we have a problem if all return empty
have_received_results = False
for dc in self._core_datacenters:
query = ('kafka_burrow_partition_lag{{'
query = ('kafka_burrow_partition_lag{'
' group="cpjobqueue-cirrusSearchElasticaWrite",'
' topic=~"[[:alpha:]]*.cpjobqueue.partitioned.mediawiki.job.cirrusSearchElasticaWrite"'
'}}')
'}')
# Query returns a list of dictionaries each of format {'metric': {}, 'value': [$timestamp, $value]}
results = self._prometheus.query(query, dc)
if not results:
Expand Down

0 comments on commit c1ca7ba

Please sign in to comment.