fix: headers is array not object

This commit is contained in:
Stefan Strigler 2023-06-01 20:48:15 +02:00
parent c7f177054c
commit c9ef1ccacd
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
{application, emqx_prometheus, [
{description, "Prometheus for EMQX"},
% strict semver, bump manually!
{vsn, "5.0.11"},
{vsn, "5.0.12"},
{modules, []},
{registered, [emqx_prometheus_sup]},
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},

View File

@ -59,7 +59,7 @@ fields("prometheus") ->
?HOCON(
list({string(), string()}),
#{
default => #{},
default => [],
required => false,
converter => fun ?MODULE:convert_headers/1,
desc => ?DESC(headers)
@ -149,6 +149,8 @@ fields("prometheus") ->
desc("prometheus") -> ?DESC(prometheus);
desc(_) -> undefined.
convert_headers(<<>>) ->
[];
convert_headers(Headers) when is_map(Headers) ->
maps:fold(
fun(K, V, Acc) ->