| 
									
										
										
										
											2020-07-14 21:42:52 +08:00
										 |  |  | %% 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/. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2024-02-06 00:53:36 +08:00
										 |  |  | %% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved. | 
					
						
							| 
									
										
										
										
											2020-07-14 21:42:52 +08:00
										 |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | %% ---------------------------------------------------------------------------- | 
					
						
							|  |  |  | %% RabbitMQ Prometheus Plugin | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% See https://rabbitmq.com/prometheus.html for details | 
					
						
							|  |  |  | %% ---------------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-11 21:08:00 +08:00
										 |  |  | %% Option to return metrics per-object, unaggregated | 
					
						
							|  |  |  | {mapping, "prometheus.return_per_object_metrics", "rabbitmq_prometheus.return_per_object_metrics", | 
					
						
							| 
									
										
										
										
											2020-02-07 01:37:37 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 18:39:21 +08:00
										 |  |  | %% Endpoint path | 
					
						
							|  |  |  | {mapping, "prometheus.path", "rabbitmq_prometheus.path", | 
					
						
							|  |  |  |     [{datatype, string}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | %% 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"}]} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-04 23:24:02 +08:00
										 |  |  | {mapping, "prometheus.tcp.listener", "rabbitmq_prometheus.tcp_config", | 
					
						
							|  |  |  |     [{datatype, [{enum, [none]}, ip]}]}. | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | {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"]}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-04 23:24:02 +08:00
										 |  |  | {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 | 
					
						
							|  |  |  | }. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | {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"]}]}. | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | {mapping, "prometheus.ssl.certfile", "rabbitmq_prometheus.ssl_config.ssl_opts.certfile", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, string}, {validators, ["file_accessible"]}]}. | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.keyfile", "rabbitmq_prometheus.ssl_config.ssl_opts.keyfile", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, string}, {validators, ["file_accessible"]}]}. | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.cacertfile", "rabbitmq_prometheus.ssl_config.ssl_opts.cacertfile", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, string}, {validators, ["file_accessible"]}]}. | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.password", "rabbitmq_prometheus.ssl_config.ssl_opts.password", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, string}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.verify", "rabbitmq_prometheus.ssl_config.ssl_opts.verify", [ | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     {datatype, {enum, [verify_peer, verify_none]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.fail_if_no_peer_cert", "rabbitmq_prometheus.ssl_config.ssl_opts.fail_if_no_peer_cert", [ | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     {datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.honor_cipher_order", "rabbitmq_prometheus.ssl_config.ssl_opts.honor_cipher_order", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.honor_ecc_order", "rabbitmq_prometheus.ssl_config.ssl_opts.honor_ecc_order", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.reuse_sessions", "rabbitmq_prometheus.ssl_config.ssl_opts.reuse_sessions", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.secure_renegotiate", "rabbitmq_prometheus.ssl_config.ssl_opts.secure_renegotiate", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.client_renegotiation", "rabbitmq_prometheus.ssl_config.ssl_opts.client_renegotiation", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, {enum, [true, false]}}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.depth", "rabbitmq_prometheus.ssl_config.ssl_opts.depth", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, integer}, {validators, ["byte"]}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.versions.$version", "rabbitmq_prometheus.ssl_config.ssl_opts.versions", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, atom}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {translation, "rabbitmq_prometheus.ssl_config.ssl_opts.versions", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | fun(Conf) -> | 
					
						
							|  |  |  |     Settings = cuttlefish_variable:filter_by_prefix("prometheus.ssl.versions", Conf), | 
					
						
							|  |  |  |     [V || {_, V} <- Settings] | 
					
						
							|  |  |  | end}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {mapping, "prometheus.ssl.ciphers.$cipher", "rabbitmq_prometheus.ssl_config.ssl_opts.ciphers", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  |     [{datatype, string}]}. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 20:33:18 +08:00
										 |  |  | {translation, "rabbitmq_prometheus.ssl_config.ssl_opts.ciphers", | 
					
						
							| 
									
										
										
										
											2019-09-26 18:08:17 +08:00
										 |  |  | 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"]}]}. | 
					
						
							| 
									
										
										
										
											2021-11-16 23:53:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-22 09:58:43 +08:00
										 |  |  | %% 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}]}. | 
					
						
							| 
									
										
										
										
											2024-06-20 15:19:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-21 03:21:42 +08:00
										 |  |  | %% Authentication options ======================================================== | 
					
						
							|  |  |  | {mapping, "prometheus.authentication.enabled", "rabbitmq_prometheus.authentication.enabled", | 
					
						
							|  |  |  |     [{datatype, {enum, [true, false]}}]}. |