fix: headers is array not object
This commit is contained in:
parent
c7f177054c
commit
c9ef1ccacd
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_prometheus, [
|
{application, emqx_prometheus, [
|
||||||
{description, "Prometheus for EMQX"},
|
{description, "Prometheus for EMQX"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.11"},
|
{vsn, "5.0.12"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_prometheus_sup]},
|
{registered, [emqx_prometheus_sup]},
|
||||||
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},
|
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},
|
||||||
|
|
|
@ -59,7 +59,7 @@ fields("prometheus") ->
|
||||||
?HOCON(
|
?HOCON(
|
||||||
list({string(), string()}),
|
list({string(), string()}),
|
||||||
#{
|
#{
|
||||||
default => #{},
|
default => [],
|
||||||
required => false,
|
required => false,
|
||||||
converter => fun ?MODULE:convert_headers/1,
|
converter => fun ?MODULE:convert_headers/1,
|
||||||
desc => ?DESC(headers)
|
desc => ?DESC(headers)
|
||||||
|
@ -149,6 +149,8 @@ fields("prometheus") ->
|
||||||
desc("prometheus") -> ?DESC(prometheus);
|
desc("prometheus") -> ?DESC(prometheus);
|
||||||
desc(_) -> undefined.
|
desc(_) -> undefined.
|
||||||
|
|
||||||
|
convert_headers(<<>>) ->
|
||||||
|
[];
|
||||||
convert_headers(Headers) when is_map(Headers) ->
|
convert_headers(Headers) when is_map(Headers) ->
|
||||||
maps:fold(
|
maps:fold(
|
||||||
fun(K, V, Acc) ->
|
fun(K, V, Acc) ->
|
||||||
|
|
Loading…
Reference in New Issue