diff options
author | kballou <kballou@devnulllabs.io> | 2016-06-21 12:48:42 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2016-06-21 12:48:42 -0600 |
commit | c2425e761ab12ca249f0430009d4ef6b20700675 (patch) | |
tree | 48c33d96c6199e5b3432bd1a59f195536f0237c5 | |
parent | 1480de1b091ea7f83f2d422d9db910ab5b64c176 (diff) | |
download | ex_prometheus_io-c2425e761ab12ca249f0430009d4ef6b20700675.tar.gz ex_prometheus_io-c2425e761ab12ca249f0430009d4ef6b20700675.tar.xz |
Add URI.encode to url building
This fixes issues with spaces being in the query string, e.g., queries like
`avg(up) by (job)` would fail without running the query (and URL string)
through URI.encode
-rw-r--r-- | lib/ex_prometheus_io/query.ex | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ex_prometheus_io/query.ex b/lib/ex_prometheus_io/query.ex index 0c346b5..bd4bb9c 100644 --- a/lib/ex_prometheus_io/query.ex +++ b/lib/ex_prometheus_io/query.ex @@ -2,6 +2,7 @@ defmodule ExPrometheusIo.Query do def process(query, query_opts, query_ref, owner) do build_url(query, query_opts) + |> URI.encode |> fetch_json() |> Poison.decode |> send_results(query_ref, owner) |