Merge pull request #11237 from zhongwencool/prometheus-api-schema
fix: bad prometheus schema for headers
This commit is contained in:
commit
f9e54ed8b1
|
@ -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.13"},
|
{vsn, "5.0.14"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_prometheus_sup]},
|
{registered, [emqx_prometheus_sup]},
|
||||||
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},
|
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},
|
||||||
|
@ -11,7 +11,6 @@
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
{maintainers, ["EMQX Team <contact@emqx.io>"]},
|
{maintainers, ["EMQX Team <contact@emqx.io>"]},
|
||||||
{links, [
|
{links, [
|
||||||
{"Homepage", "https://emqx.io/"},
|
{"Homepage", "https://emqx.io/"}
|
||||||
{"Github", "https://github.com/emqx/emqx-prometheus"}
|
|
||||||
]}
|
]}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -130,10 +130,8 @@ prometheus_data_schema() ->
|
||||||
description =>
|
description =>
|
||||||
<<"Get Prometheus Data. Note that support for JSON output is deprecated and will be removed in v5.2.">>,
|
<<"Get Prometheus Data. Note that support for JSON output is deprecated and will be removed in v5.2.">>,
|
||||||
content =>
|
content =>
|
||||||
#{
|
[
|
||||||
'application/json' =>
|
{'text/plain', #{schema => #{type => string}}},
|
||||||
#{schema => #{type => object}},
|
{'application/json', #{schema => #{type => object}}}
|
||||||
'text/plain' =>
|
]
|
||||||
#{schema => #{type => string}}
|
|
||||||
}
|
|
||||||
}.
|
}.
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
The `headers` default value in /prometheus API should be a map instead of a list.
|
Loading…
Reference in New Issue