1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
%%
%% ----------------------------------------------------------------------------
%% RabbitMQ Prometheus Plugin
%%
%% See https://rabbitmq.com/prometheus.html for details
%% ----------------------------------------------------------------------------
%% Option to return metrics per-object, unaggregated
{mapping, "prometheus.return_per_object_metrics", "rabbitmq_prometheus.return_per_object_metrics",
[{datatype, {enum, [true, false]}}]}.
%% Endpoint path
{mapping, "prometheus.path", "rabbitmq_prometheus.path",
[{datatype, string}]}.
%% HTTP (TCP) listener options ========================================================
%% HTTP listener consistent with the management plugin, Web STOMP and Web MQTT.
%%
%% {tcp_config, [{port, 15692},
%% {ip, "127.0.0.1"}]}
{mapping, "prometheus.tcp.listener", "rabbitmq_prometheus.tcp_config",
[{datatype, [{enum, [none]}, ip]}]}.
{mapping, "prometheus.tcp.port", "rabbitmq_prometheus.tcp_config.port",
[{datatype, integer}]}.
{mapping, "prometheus.tcp.ip", "rabbitmq_prometheus.tcp_config.ip",
[{datatype, string},
{validators, ["is_ip"]}]}.
{translation,
"rabbitmq_prometheus.tcp_config",
fun(Conf) ->
Setting = cuttlefish:conf_get("prometheus.tcp.listener", Conf, undefined),
case Setting of
none -> [];
undefined -> [{port, 15692}];
{Ip, Port} when is_list(Ip), is_integer(Port) ->
[{ip, Ip}, {port, Port}]
end
end
}.
{mapping, "prometheus.tcp.compress", "rabbitmq_prometheus.tcp_config.cowboy_opts.compress",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.tcp.idle_timeout", "rabbitmq_prometheus.tcp_config.cowboy_opts.idle_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.tcp.inactivity_timeout", "rabbitmq_prometheus.tcp_config.cowboy_opts.inactivity_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.tcp.request_timeout", "rabbitmq_prometheus.tcp_config.cowboy_opts.request_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.tcp.shutdown_timeout", "rabbitmq_prometheus.tcp_config.cowboy_opts.shutdown_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.tcp.max_keepalive", "rabbitmq_prometheus.tcp_config.cowboy_opts.max_keepalive",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
%% HTTPS (TLS) listener options ========================================================
%% HTTPS listener consistent with the management plugin, Web STOMP and Web MQTT.
%%
%% {ssl_config, [{port, 15691},
%% {ip, "127.0.0.1"},
%% {cacertfile, "/path/to/cacert.pem"},
%% {certfile, "/path/to/cert.pem"},
%% {keyfile, "/path/to/key.pem"}]}
{mapping, "prometheus.ssl.port", "rabbitmq_prometheus.ssl_config.port",
[{datatype, integer}]}.
{mapping, "prometheus.ssl.backlog", "rabbitmq_prometheus.ssl_config.backlog",
[{datatype, integer}]}.
{mapping, "prometheus.ssl.ip", "rabbitmq_prometheus.ssl_config.ip",
[{datatype, string}, {validators, ["is_ip"]}]}.
{mapping, "prometheus.ssl.certfile", "rabbitmq_prometheus.ssl_config.ssl_opts.certfile",
[{datatype, string}, {validators, ["file_accessible"]}]}.
{mapping, "prometheus.ssl.keyfile", "rabbitmq_prometheus.ssl_config.ssl_opts.keyfile",
[{datatype, string}, {validators, ["file_accessible"]}]}.
{mapping, "prometheus.ssl.cacertfile", "rabbitmq_prometheus.ssl_config.ssl_opts.cacertfile",
[{datatype, string}, {validators, ["file_accessible"]}]}.
{mapping, "prometheus.ssl.password", "rabbitmq_prometheus.ssl_config.ssl_opts.password",
[{datatype, string}]}.
{mapping, "prometheus.ssl.verify", "rabbitmq_prometheus.ssl_config.ssl_opts.verify", [
{datatype, {enum, [verify_peer, verify_none]}}]}.
{mapping, "prometheus.ssl.fail_if_no_peer_cert", "rabbitmq_prometheus.ssl_config.ssl_opts.fail_if_no_peer_cert", [
{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.honor_cipher_order", "rabbitmq_prometheus.ssl_config.ssl_opts.honor_cipher_order",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.honor_ecc_order", "rabbitmq_prometheus.ssl_config.ssl_opts.honor_ecc_order",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.reuse_sessions", "rabbitmq_prometheus.ssl_config.ssl_opts.reuse_sessions",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.secure_renegotiate", "rabbitmq_prometheus.ssl_config.ssl_opts.secure_renegotiate",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.client_renegotiation", "rabbitmq_prometheus.ssl_config.ssl_opts.client_renegotiation",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.depth", "rabbitmq_prometheus.ssl_config.ssl_opts.depth",
[{datatype, integer}, {validators, ["byte"]}]}.
{mapping, "prometheus.ssl.versions.$version", "rabbitmq_prometheus.ssl_config.ssl_opts.versions",
[{datatype, atom}]}.
{translation, "rabbitmq_prometheus.ssl_config.ssl_opts.versions",
fun(Conf) ->
Settings = cuttlefish_variable:filter_by_prefix("prometheus.ssl.versions", Conf),
[V || {_, V} <- Settings]
end}.
{mapping, "prometheus.ssl.ciphers.$cipher", "rabbitmq_prometheus.ssl_config.ssl_opts.ciphers",
[{datatype, string}]}.
{translation, "rabbitmq_prometheus.ssl_config.ssl_opts.ciphers",
fun(Conf) ->
Settings = cuttlefish_variable:filter_by_prefix("prometheus.ssl.ciphers", Conf),
lists:reverse([V || {_, V} <- Settings])
end}.
{mapping, "prometheus.ssl.compress", "rabbitmq_prometheus.ssl_config.cowboy_opts.compress",
[{datatype, {enum, [true, false]}}]}.
{mapping, "prometheus.ssl.idle_timeout", "rabbitmq_prometheus.ssl_config.cowboy_opts.idle_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.ssl.inactivity_timeout", "rabbitmq_prometheus.ssl_config.cowboy_opts.inactivity_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.ssl.request_timeout", "rabbitmq_prometheus.ssl_config.cowboy_opts.request_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.ssl.shutdown_timeout", "rabbitmq_prometheus.ssl_config.cowboy_opts.shutdown_timeout",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
{mapping, "prometheus.ssl.max_keepalive", "rabbitmq_prometheus.ssl_config.cowboy_opts.max_keepalive",
[{datatype, integer}, {validators, ["non_negative_integer"]}]}.
%% Kept for compatibility reasons. This is a no-op.
{mapping, "prometheus.filter_aggregated_queue_metrics_pattern", "rabbitmq_prometheus.filter_aggregated_queue_metrics_pattern",
[{datatype, string}]}.
%% Authentication options ========================================================
{mapping, "prometheus.authentication.enabled", "rabbitmq_prometheus.authentication.enabled",
[{datatype, {enum, [true, false]}}]}.
|