Merge pull request #11237 from zhongwencool/prometheus-api-schema

fix: bad prometheus schema for headers
This commit is contained in:
zhongwencool 2023-07-10 18:13:42 +08:00 committed by GitHub
commit f9e54ed8b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@
{application, emqx_prometheus, [
{description, "Prometheus for EMQX"},
% strict semver, bump manually!
{vsn, "5.0.13"},
{vsn, "5.0.14"},
{modules, []},
{registered, [emqx_prometheus_sup]},
{applications, [kernel, stdlib, prometheus, emqx, emqx_management]},
@ -11,7 +11,6 @@
{licenses, ["Apache-2.0"]},
{maintainers, ["EMQX Team <contact@emqx.io>"]},
{links, [
{"Homepage", "https://emqx.io/"},
{"Github", "https://github.com/emqx/emqx-prometheus"}
{"Homepage", "https://emqx.io/"}
]}
]}.

View File

@ -130,10 +130,8 @@ prometheus_data_schema() ->
description =>
<<"Get Prometheus Data. Note that support for JSON output is deprecated and will be removed in v5.2.">>,
content =>
#{
'application/json' =>
#{schema => #{type => object}},
'text/plain' =>
#{schema => #{type => string}}
}
[
{'text/plain', #{schema => #{type => string}}},
{'application/json', #{schema => #{type => object}}}
]
}.

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)

View File

@ -0,0 +1 @@
The `headers` default value in /prometheus API should be a map instead of a list.