Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added flow to queue state case statement #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eduardomb08
Copy link

@eduardomb08 eduardomb08 commented Jul 13, 2020

Attempt to solve #100. I tried building locally to test it but was unable to. After installing MSYS2 on my Win10 laptop with necessary packages I got errors when running "make deps" (see example below)

Crash dump is being written to: erl_crash.dump...done
DEP credentials_obfuscation (2.0.0)
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{init,start_it,1,[{file,"init.erl"},{line,1137}]},{init,start_em,1,[{file,"init.erl"},{line,1123}]},{init,do_boot,3,[{file,"init.erl"},{line,831}]}]}}
init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{},{}]},{erl_eval,exprs,5,[{},{}]},{init,start_it,1,[{},{}]},{init,start_em,1,[{},{}]},{init,do_boot,3,[{},{}]}

Crash dump is being written to: erl_crash.dump...done
make[2]: Entering directory '/c/temp/prometheus_rabbitmq_exporter/deps/rabbitmq_codegen'
make[2]: Leaving directory '/c/temp/prometheus_rabbitmq_exporter/deps/rabbitmq_codegen'
Error: No Makefile to build dependency /c/temp/prometheus_rabbitmq_exporter/deps/lager.
make[1]: *** [erlang.mk:4512: deps] Error 2
make[1]: Leaving directory '/c/temp/prometheus_rabbitmq_exporter/deps/rabbit_common'
make: *** [erlang.mk:4314: deps] Error 2

And the partial contents of erl_crash.dump:
=erl_crash_dump:0.5
Mon Jul 13 15:10:02 2020
Slogan: init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{},{}]},{erl_eval,exprs,5,[{},{}]},{init,start_it,1,[{},{}]},{init,start_em,1,[{},{}]},{init,do_boot,3,[{},{}]}
System version: Erlang/OTP 23 [erts-11.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Compiled: Wed May 20 14:04:00 2020

I also tried the same with an older version or Erlang (10.2) with same/similar error.

PS: It would be nice to have a section somewhere explaining how to build it.

@eduardomb08
Copy link
Author

I was able to fix some missing dependencies but I still can't build it all the way. Now I get the following error:

`
$ make deps

make[1]: Entering directory '/c/temp/prometheus_rabbitmq_exporter/deps/prometheus_process_collector'
/mingw64/bin/gcc -o priv/prometheus_process_collector_drv.so -L "c:/Program Files/erl-23.0.1/lib/erl_interface-4.0/lib" -lei -shared
make[2]: *** [c_src/Makefile.erlang.mk:21: priv/prometheus_process_collector_drv.so] Error 1
make[1]: *** [Makefile:24: pre-app] Error 2
make[1]: Leaving directory '/c/temp/prometheus_rabbitmq_exporter/deps/prometheus_process_collector'
make: *** [erlang.mk:4512: deps] Error 2
`

@@ -53,6 +53,7 @@
running -> 0;
undefined -> undefined;
down -> undefined;
flow -> undefined;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure "undefined" would be the best value here, but it seemed better than zero or MsgCount.

eduardomb08 referenced this pull request Jul 14, 2020
* Remove redundant Dockerfile ARG

* Allow overriding DOCKER_BASE_IMAGE when building Docker image

* Add make target that allows building ezs in a specific OTP context

This was necessary to test that the fixes for #75 work in RabbitMQ
v3.7.9 & OTP v21.2.5, the combo that ships in Docker image
rabbitmq:3.7.9. This is the first RabbitMQ Docker image that supports
prometheus_rabbitmq_exporter (compiled with OTP v21.0.2). Docker image
rabbitmq:3.7.8 ships with OTP v20.3.8.5

Notice that I disable prometheus_process_collector in the Docker build
context. This fails to build due to Docker image erlang:21.2.5 missing
native libs. Didn't want to shave this yak as well.

* Fix metric mappings to ETS tables

In RabbitMQ v3.7.x, the following mappings were not valid and would
result in crashes when a produce/consumer would connect to RabbitMQ:

* connection_metrics
  * connection_recv_count, recv_count
  * connection_send_count, send_count

* channel_queue_metrics
  * channel_queue_get, get
  * channel_queue_get_no_ack, get_no_ack
  * channel_queue_deliver, deliver
  * channel_queue_deliver_no_ack, deliver_no_ack
  * channel_queue_redeliver, redeliver
  * channel_queue_ack, ack
  * channel_queue_get_empty, get_empty

The following metric was mapped incorrectly:

* connection_churn_metrics
  * 7, queue_deleted

There is more line churn in this commit than necessary. I was
re-formatting all metrics as I was going over all mappings. This
confirms that I've checked that all mappings are accurate.

I've tested manually against current v3.7.x branch via `make run-broker`
as well as rabbitmq:3.7.9 Docker image:

    make distclean

    make otp-21.2.5-build-context

      make /usr/local/bin/elixir
      apt update && apt install zip
      make ezs
      ^D

    make docker_build DOCKER_BASE_IMAGE=rabbitmq:3.7.9-management
    docker run -it -p 5672:5672 -p 15672:15672 deadtrickster/rabbitmq_prometheus:3.7

    cd ~/github.com/rabbitmq/rabbitmq-perf-test
    make run ARGS="-x 1 -y 1 -r 1"

    curl localhost:15672/api/metrics
    # NO CRASHES!

Fixes #75

cc @dcorbacho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants