Skip to content

Commit

Permalink
sync with prometheus_httpd and use pre18 compat branch
Browse files Browse the repository at this point in the history
  • Loading branch information
deadtrickster committed Sep 21, 2017
1 parent 8f66b03 commit 792a0a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PROJECT = prometheus_rabbitmq_exporter
PROJECT_DESCRIPTION = Prometheus.io exporter as a RabbitMQ Managment Plugin plugin

DEPS = rabbitmq_management prometheus prometheus_process_collector prometheus_httpd accept
dep_prometheus = git https://github.com/deadtrickster/prometheus.erl
dep_prometheus_process_collector = git https://github.com/deadtrickster/prometheus_process_collector
DEPS = rabbitmq_management prometheus prometheus_httpd accept #prometheus_process_collector
dep_prometheus = git https://github.com/deadtrickster/prometheus.erl 3.x-pre18
#dep_prometheus_process_collector = git https://github.com/deadtrickster/prometheus_process_collector
dep_prometheus_httpd = git https://github.com/deadtrickster/prometheus-httpd
dep_accept = git https://github.com/deadtrickster/accept

Expand Down
2 changes: 1 addition & 1 deletion src/prometheus_rabbitmq_exporter.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dispatcher() ->
Path = prometheus_rabbitmq_exporter_config:path(),
Registry = default,

prometheus_http:setup(),
prometheus_http_impl:setup(),

[{Path, prometheus_rabbitmq_exporter_handler, {Registry}}].
web_ui() -> [].
10 changes: 6 additions & 4 deletions src/prometheus_rabbitmq_exporter_handler.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-module(prometheus_rabbitmq_exporter_handler).

-include_lib("prometheus_httpd/include/prometheus_http.hrl").

-export([init/3,
handle/2,
terminate/3]).
Expand All @@ -16,10 +18,10 @@ handle(Req, {Registry}) ->
end,

%% TODO: check method, response only to GET
{Code, RespHeaders0, Body} = prometheus_http:reply(#{path => URI,
headers => GetHeader,
registry => Registry,
standalone => false}),
{Code, RespHeaders0, Body} = prometheus_http_impl:reply(#request{path = URI,
headers = GetHeader,
registry = Registry,
standalone = false}),

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

0 comments on commit 792a0a9

Please sign in to comment.