簡體   English   中英

Rabbitmq Prometheus 插件指標得到 204 無內容錯誤

[英]Rabbitmq Prometheus Plugin Metrics get 204 No Content Error

我已經在 Erlang 23.3.4.11 版本上安裝了 RabbitMQ 3.8.0
我啟用了與文檔https://www.rabbitmq.com/prometheus.html相關的rabbitmq_prometheus 插件

rabbitmq-plugins 啟用 rabbitmq_prometheus

當我嘗試獲取指標時
curl -I http://localhost:15692/metrics
回應:

HTTP/1.1 204 No Content
the server responded with a status of 500

如何使用插件在 rabbitmq 上獲取 prometheus 指標?

錯誤是退出,原因是 badarg 和 stacktrace

診斷狀態

Status of node rabbit@iotdev4 ...
Runtime

OS PID: 760
OS: Linux
Uptime (seconds): 853806
RabbitMQ version: 3.8.0
Node name: rabbit@iotdev4
Erlang configuration: Erlang/OTP 23 [erts-11.2.2.10] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:64] [hipe]
Erlang processes: 5347 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:

 * rabbitmq_mqtt
 * rabbitmq_delayed_message_exchange
 * rabbitmq_message_timestamp
 * rabbitmq_management
 * rabbitmq_prometheus
 * rabbitmq_management_agent
 * rabbitmq_web_dispatch
 * amqp_client
 * cowboy
 * prometheus
 * cowlib

Data directory

Node data directory: /data/rabbitmq/mnesia/rabbit@iotdev4

Config files

 * /etc/rabbitmq/rabbitmq.conf

Log file(s)

 * /data/rabbitmq/log/rabbit@iotdev4.log
 * /data/rabbitmq/log/rabbit@iotdev4_upgrade.log

Alarms

(none)

Memory

Calculation strategy: rss
Memory high watermark setting: 8.0 gb, computed to: 8.0 gb
msg_index: 2.2501 gb (43.61 %)
mnesia: 0.93 gb (18.03 %)
binary: 0.7197 gb (13.95 %)
allocated_unused: 0.7025 gb (13.62 %)
other_ets: 0.2647 gb (5.13 %)
queue_procs: 0.1142 gb (2.21 %)
other_proc: 0.048 gb (0.93 %)
plugins: 0.037 gb (0.72 %)
mgmt_db: 0.0288 gb (0.56 %)
code: 0.0276 gb (0.54 %)
other_system: 0.0161 gb (0.31 %)
connection_other: 0.0094 gb (0.18 %)
metrics: 0.0031 gb (0.06 %)
connection_readers: 0.0025 gb (0.05 %)
quorum_ets: 0.0022 gb (0.04 %)
connection_channels: 0.0017 gb (0.03 %)
atom: 0.0014 gb (0.03 %)
connection_writers: 0.0005 gb (0.01 %)
quorum_queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
reserved_unallocated: 0.0 gb (0.0 %)

File Descriptors

Total: 1033, limit: 32668
Sockets: 69, limit: 29399

Free Disk Space

Low free disk space watermark: 0.05 gb
Free disk space: 322.3938 gb

Totals

Connection count: 65
Queue count: 740
Virtual host count: 157

Listeners

Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Interface: [::], port: 15692, protocol: http/prometheus, purpose: Prometheus exporter API over HTTP
Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: [::], port: 1883, protocol: mqtt, purpose: MQTT

錯誤日志

[iotadmin@iotdev4 ~]$ sudo tail -200f /data/rabbitmq/log/rabbit@iotdev4.log | grep 15692
2022-03-22 11:20:00.368 [error] <0.32605.488> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.32605.488>, stream 1 had its request process <0.32683.488> exit with reason badarg and stacktrace []
2022-03-22 11:21:00.341 [error] <0.32445.488> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.32445.488>, stream 1 had its request process <0.32690.488> exit with reason badarg and stacktrace []
2022-03-22 11:21:19.096 [error] <0.30938.488> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.30938.488>, stream 1 had its request process <0.32141.488> exit with reason badarg and stacktrace []
2022-03-22 11:22:00.351 [error] <0.696.489> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.696.489>, stream 1 had its request process <0.301.489> exit with reason badarg and stacktrace []
2022-03-22 11:23:00.331 [error] <0.1375.489> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.1375.489>, stream 1 had its request process <0.826.489> exit with reason badarg and stacktrace []
2022-03-22 11:23:52.741 [error] <0.31867.488> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.31867.488>, stream 1 had its request process <0.982.489> exit with reason badarg and stacktrace []
2022-03-22 11:24:00.335 [error] <0.25927.488> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.25927.488>, stream 1 had its request process <0.1781.489> exit with reason badarg and stacktrace []
2022-03-22 11:25:00.463 [error] <0.1213.489> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.1213.489>, stream 1 had its request process <0.2037.489> exit with reason badarg and stacktrace []
2022-03-22 11:26:00.356 [error] <0.1565.489> Ranch listener rabbit_web_dispatch_sup_15692, connection process <0.1565.489>, stream 1 had its request process <0.1853.489> exit with reason badarg and stacktrace []


2022-02-28 15:34:42.677 [info] <0.319.0> Running boot step rabbit_core_metrics defined by app rabbit
2022-02-28 15:35:25.172 [info] <0.319.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
2022-02-28 16:30:54.335 [info] <0.28155.21> Prometheus metrics: HTTP (non-TLS) listener started on port 15692
2022-02-28 16:36:26.049 [info] <0.322.0> Running boot step rabbit_core_metrics defined by app rabbit
2022-02-28 16:37:08.351 [info] <0.322.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
2022-02-28 16:37:08.358 [info] <0.32739.11> Prometheus metrics: HTTP (non-TLS) listener started on port 15692
2022-02-28 16:38:37.043 [info] <0.2393.12> Prometheus metrics: HTTP (non-TLS) listener started on port 15692
2022-02-28 16:51:03.032 [info] <0.324.0> Running boot step rabbit_core_metrics defined by app rabbit
2022-02-28 16:51:44.709 [info] <0.324.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
2022-02-28 16:51:44.740 [info] <0.32740.11> Prometheus metrics: HTTP (non-TLS) listener started on port 15692
2022-02-28 16:53:46.888 [info] <0.322.0> Running boot step rabbit_core_metrics defined by app rabbit
2022-02-28 16:54:27.961 [info] <0.322.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
2022-02-28 16:54:27.968 [info] <0.32736.11> Prometheus metrics: HTTP (non-TLS) listener started on port 15692

如果你打電話:

curl -I http://localhost:15692/metrics
# -I, --head          Show document info only

然后服務器不返回正文,不返回內容:

HTTP 204 No Content 成功狀態響應代碼表示請求已成功,但客戶端不需要離開其當前頁面。

嘗試使用命令對其進行測試:

# aggregated metrics by default (config: prometheus.return_per_object_metrics = false)
curl -v http://localhost:15692/metrics | head -n 10

# per-object (unaggregated) metrics
curl -v http://localhost:15692/metrics/per_object | head -n 10

更多信息: https ://www.rabbitmq.com/prometheus.html#prometheus-configuration

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM