Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 792a0a9

Browse files
committed
sync with prometheus_httpd and use pre18 compat branch
1 parent 8f66b03 commit 792a0a9

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Diff for: Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PROJECT = prometheus_rabbitmq_exporter
22
PROJECT_DESCRIPTION = Prometheus.io exporter as a RabbitMQ Managment Plugin plugin
33

4-
DEPS = rabbitmq_management prometheus prometheus_process_collector prometheus_httpd accept
5-
dep_prometheus = git https://github.com/deadtrickster/prometheus.erl
6-
dep_prometheus_process_collector = git https://github.com/deadtrickster/prometheus_process_collector
4+
DEPS = rabbitmq_management prometheus prometheus_httpd accept #prometheus_process_collector
5+
dep_prometheus = git https://github.com/deadtrickster/prometheus.erl 3.x-pre18
6+
#dep_prometheus_process_collector = git https://github.com/deadtrickster/prometheus_process_collector
77
dep_prometheus_httpd = git https://github.com/deadtrickster/prometheus-httpd
88
dep_accept = git https://github.com/deadtrickster/accept
99

Diff for: src/prometheus_rabbitmq_exporter.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dispatcher() ->
99
Path = prometheus_rabbitmq_exporter_config:path(),
1010
Registry = default,
1111

12-
prometheus_http:setup(),
12+
prometheus_http_impl:setup(),
1313

1414
[{Path, prometheus_rabbitmq_exporter_handler, {Registry}}].
1515
web_ui() -> [].

Diff for: src/prometheus_rabbitmq_exporter_handler.erl

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
-module(prometheus_rabbitmq_exporter_handler).
22

3+
-include_lib("prometheus_httpd/include/prometheus_http.hrl").
4+
35
-export([init/3,
46
handle/2,
57
terminate/3]).
@@ -16,10 +18,10 @@ handle(Req, {Registry}) ->
1618
end,
1719

1820
%% TODO: check method, response only to GET
19-
{Code, RespHeaders0, Body} = prometheus_http:reply(#{path => URI,
20-
headers => GetHeader,
21-
registry => Registry,
22-
standalone => false}),
21+
{Code, RespHeaders0, Body} = prometheus_http_impl:reply(#request{path = URI,
22+
headers = GetHeader,
23+
registry = Registry,
24+
standalone = false}),
2325

2426
ContentLength = integer_to_list(iolist_size(Body)),
2527
RespHeaders = lists:map(fun to_cowboy_headers/1,

0 commit comments

Comments
 (0)