fix: headers is array not object
This commit is contained in:
parent
c7f177054c
commit
c9ef1ccacd
|
@ -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]},
|
||||
|
|
|
@ -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) ->
|
||||
|
|
Loading…
Reference in New Issue