Commit Graph

518 Commits

Author SHA1 Message Date
Loïc Hoguin dc70cbf281
Update Erlang.mk and switch to new xref code 2022-05-31 13:51:12 +02:00
Michael Klishin 018b04a1ea
Wording 2022-04-26 23:08:00 +04:00
Péter Gömöri 35b21797ae Expose head_message_timestamp via Prometheus plugin as well
It is already exposed via rabbitmqctl and the API. It is also exposed by
old or unofficial prometheus plugins and other monitoring
integrations (DataDog).
2022-04-26 15:42:57 +02:00
Michael Klishin 7c47d0925a
Revert "Correct a double quote introduced in #4603"
This reverts commit 6a44e0e2ef.

That wiped a lot of files unintentionally
2022-04-20 16:05:56 +04:00
Michael Klishin 6a44e0e2ef
Correct a double quote introduced in #4603 2022-04-20 16:01:29 +04:00
Luke Bakken dba25f6462
Replace files with symlinks
This prevents duplicated and out-of-date instructions.
2022-04-15 06:04:29 -07:00
Loïc Hoguin 499e0b9197
Remove the CQv1 disabled stats from management/Prometheus 2022-04-05 12:37:54 +02:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
David Ansari a3905da47c Add note about missed Prometheus counter updates
Currently, the quorum queue state machine updates counters via mod_call effects
which are not guaranteed to be executed.

They are updated via mod_call effects such that only the leader
increments the counter (and not the followers).

In certain failure scenarios when dead-lettering lots of messages
at the same time, these mod_call effects might not be executed.

Hence, one shouldn't rely that counters for dead lettered messages
and dead lettered confirmed messages match up 100% even though all
dead-lettered messages were confirmed eventually.
2022-02-28 16:28:09 +01:00
David Ansari 8c286cc680 Add Prometheus metrics for dead-lettered messages
> curl -s localhost:15692/metrics | grep rabbitmq_global_messages_dead_lettered
\# TYPE rabbitmq_global_messages_dead_lettered_delivery_limit_total counter
\# HELP rabbitmq_global_messages_dead_lettered_delivery_limit_total Total number of messages dead-lettered due to delivery-limit exceeded
rabbitmq_global_messages_dead_lettered_delivery_limit_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_least_once"} 0
rabbitmq_global_messages_dead_lettered_delivery_limit_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_delivery_limit_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="disabled"} 0
\# TYPE rabbitmq_global_messages_dead_lettered_expired_total counter
\# HELP rabbitmq_global_messages_dead_lettered_expired_total Total number of messages dead-lettered due to message TTL exceeded
rabbitmq_global_messages_dead_lettered_expired_total{queue_type="rabbit_classic_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_expired_total{queue_type="rabbit_classic_queue",dead_letter_strategy="disabled"} 0
rabbitmq_global_messages_dead_lettered_expired_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_least_once"} 0
rabbitmq_global_messages_dead_lettered_expired_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_expired_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="disabled"} 0
\# TYPE rabbitmq_global_messages_dead_lettered_rejected_total counter
\# HELP rabbitmq_global_messages_dead_lettered_rejected_total Total number of messages dead-lettered due to basic.reject or basic.nack
rabbitmq_global_messages_dead_lettered_rejected_total{queue_type="rabbit_classic_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_rejected_total{queue_type="rabbit_classic_queue",dead_letter_strategy="disabled"} 0
rabbitmq_global_messages_dead_lettered_rejected_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_least_once"} 0
rabbitmq_global_messages_dead_lettered_rejected_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_rejected_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="disabled"} 0
\# TYPE rabbitmq_global_messages_dead_lettered_confirmed_total counter
\# HELP rabbitmq_global_messages_dead_lettered_confirmed_total Total number of messages dead-lettered and confirmed by target queues
rabbitmq_global_messages_dead_lettered_confirmed_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_least_once"} 0
\# TYPE rabbitmq_global_messages_dead_lettered_maxlen_total counter
\# HELP rabbitmq_global_messages_dead_lettered_maxlen_total Total number of messages dead-lettered due to overflow drop-head or reject-publish-dlx
rabbitmq_global_messages_dead_lettered_maxlen_total{queue_type="rabbit_classic_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_maxlen_total{queue_type="rabbit_classic_queue",dead_letter_strategy="disabled"} 0
rabbitmq_global_messages_dead_lettered_maxlen_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="at_most_once"} 0
rabbitmq_global_messages_dead_lettered_maxlen_total{queue_type="rabbit_quorum_queue",dead_letter_strategy="disabled"} 0

A few notes:
* dead_letter_strategy 'disabled' means either user did not configure
  dead-letter-exchange or configured dead-letter-exchange does not
  exist.
* Only time series that make sense get output.
  Example 1: Combination of 'at_least_once' and 'maxlen' will always be 0.
  Hence, we omit that time series.
  Example 2: 'confirmed' makes only sense with quorum queues and
  'at_least_once'.
  Example 3: 'delivery_limit' makes only sense with quorum queues.
* Users get to know *why* messages were dead-lettered.
* Before this commit, there was no possibilities for users to alert
  based on messages being dropped from the head of the queue when
  overflow=drop-head.
* Users can now easily create alerts:
  Example 1: Message gets silently dropped (i.e.
  dead_letter_strategy='disabled') instead of actually dead-lettered.
  Example 2: Detect dead-letter topology misconfigurations.
  Example 3: Messages expire
  Example 4: Messages overflow
  Example 5: Messages requeued too often
* Stream queues by definition do not dead-letter.
2022-02-28 16:28:02 +01:00
Philip Kuryloski 226e00fcd2 Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps
2022-02-24 11:18:41 +01:00
Philip Kuryloski d8201726ae Ignore dialyzer warnings for most apps 2022-02-21 09:19:56 +01:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Alexey Lebedeff 7676ed9685 Use `rabbitmq_cluster_` prefix for cluster-wide metrics 2021-11-24 16:49:43 +01:00
Michael Klishin 38d64a54b1
Wording 2021-11-24 14:19:57 +03:00
Michael Klishin a1c0cd3785
Wording 2021-11-24 14:02:10 +03:00
Alexey Lebedeff 6e3012aaf9 Add optional metrics for vhost and exchange count
These can make sense in some scenarios, e.g. when vhost/exchanges are
+created using self-service automation
2021-11-24 11:00:41 +01:00
Luke Bakken bd2858c208
Compile the regex 2021-11-22 08:30:17 -08:00
dcorbacho a7c9b66653 Use own key to exclude queues 2021-11-16 16:53:17 +01:00
dcorbacho 242cb539b3 Exclude queues from aggregated metrics in prometheus collector
Uses same exclusion pattern as the management agent
2021-11-16 10:23:39 +01:00
Alexey Lebedeff 8598c51579 Pre-render prometheus labels
This makes per-object metrics twice as fast.

Depends on https://github.com/deadtrickster/prometheus.erl/pull/137
2021-11-09 13:04:39 +01:00
Alexey Lebedeff b9ebfb8980 Fix ssl port handling in prometheus plugin
All ssl options were stored in the same proplist, and the code was
then trying to determine whether an option actually belongs to ranch
ssl options or not.

Some keys landed in the wrong place, like it did happen in #2975 -
different ports were mentioned in listener config (default at
top-level, and non-default in `ssl_opts`). Then `ranch` and
`rabbitmq_web_dispatch` were treating this differently.

This change just moves all ranch ssl opts into proper place using
schema, removing any need for guessing in code.

The only downside is that advanced config compatibility is broken.
2021-10-20 14:55:33 +02:00
Michael Klishin 3826a0df25
Compile #3561 2021-10-13 01:27:16 +03:00
Michael Klishin 670f240537
Compile #3561 2021-10-12 20:17:51 +03:00
Johannes Würbach 84de860b4c
feat(prom): expose cluster id in identity 2021-10-12 15:43:46 +02:00
Alexey Lebedeff 989a299720 Emit identity info in prometheus /metrics/detailed endpoint
This is needed to make filtering metrics on a cluster name possible.
2021-09-28 19:35:02 +02:00
Alexey Lebedeff 5501d07b8b Use rabbitmq_ct_helpers to allocate prometheus port
This test always used standard 15692 before, which were causing
conflicts with e.g. local `make run-broker`.
2021-09-22 15:23:35 +02:00
Alexey Lebedeff 4bb2262140 Allow selective querying for prometheus plugin 2021-09-20 14:59:17 +02:00
Michael Klishin 47b20e8f7c
Prometheus: alarm-related metric naming 2021-08-17 20:58:24 +03:00
Ilya Khaprov 9fed915192
Add alarms prometheus collector.
close #2653
2021-08-16 20:32:29 +02:00
Gerhard Lazu 62d82e1660
Break down metrics by node in all RabbitMQ-Stream pie charts
Otherwise we won't be able to see which nodes are running "hot"

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-11 13:39:30 +01:00
David Ansari 4b774db5c1 Use same threshold color for "Errors since boot" 2021-08-02 17:05:17 +02:00
David Ansari c99ee6961e Use same colorMode in all RabbitMQ-Stream panels
Co-authored-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-02 13:33:00 +02:00
David Ansari ea18c31288 Make RabbitMQ-Stream dashboard work via ConfigMap
Before this commit, importing the dashboard via ConfigMap as seen in
1eb1dc618e
didn't work because DS_PROMETHEUS variable was undefined in Grafana.

Related to https://github.com/rabbitmq/rabbitmq-server/pull/3250

Co-authored-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-08-02 13:12:48 +02:00
Gerhard Lazu 65afbb931b
Ensure RabbitMQ-Stream dashboard works correctly after import
This breaks the docker-compose integration, but we need to move away
from it anyways, the whole dev flow needs revisiting after our focus on
K8s.

$__rate_interval does not work with irate, dropping it in favour of 60s,
same as all other dashboards.

This is a follow-up to https://github.com/rabbitmq/rabbitmq-server/pull/3250

Thanks @ansd for mentioning about the post-import issues.

It was uploaded as https://grafana.com/api/dashboards/14798/revisions/3/download

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-07-30 13:53:02 +01:00
Gerhard Lazu 35a6369327
Restart stream-perf-test on-failure
This handles the scenario where rmq2 is not available, and
stream-perf-test exits with a non-zero exit code. Good spot @ansd!

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-07-30 11:25:36 +01:00
David Ansari 47d572908d Convert string to integer for ulimits.nofile
Before this commit:

> make overview metrics
services.rmq1.ulimits.nofile.hard must be a integer
make: *** [Makefile:68: overview] Error 15

Accoring to the docs
https://docs.docker.com/compose/compose-file/compose-file-v3/#ulimits
this must be an integer.
2021-07-30 09:46:38 +02:00
Gerhard Lazu 6f5c4118ea
Publish RabbitMQ-Stream dashboard to grafana.com
Removed the Dockerfile and slimmed down the Makefile, all of this is now
handled by https://github.com/rabbitmq/rabbitmq-server/blob/master/.github/workflows/oci.yaml
cc @Zerpet @pjk25

More details here (including the steps used to publish to grafana.com):
https://github.com/rabbitmq/release-engineering/issues/11#issuecomment-887627938

I don't want to hold up this PR, will invest in automating the
steps described in the previous link another time. Time to 🚀

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-07-29 19:34:05 +01:00
Philip Kuryloski b26289cb47 Adjust rabbitmq_prometheus test suite timeouts in bazel 2021-07-22 11:00:14 +02:00
Gerhard Lazu 66ef8adfc8
Fix accept dependency in rabbitmq_prometheus
It's a runtime dependency, not a build dependency.

This is a fix and should be backported to v3.9.x, after rc.2 and just
before the final release. Would you disagree @dumbbell?

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-07-21 13:38:54 +01:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
dcorbacho b636ad2565 Rename protocol error counters to _total 2021-06-30 12:46:41 +02:00
dcorbacho c9305d948a
Use number of publishing channels as global publishers in amqp091 2021-06-29 08:10:42 +01:00
Philip Kuryloski 8c7e7e0656 Revert "Default all `rabbitmq_integration_suite` to flaky in bazel"
This reverts commit 70cb8147b2.
2021-06-23 20:53:14 +02:00
Gerhard Lazu c7971252cd
Global counters per protocol + protocol AND queue_type
This way we can show how many messages were received via a certain
protocol (stream is the second real protocol besides the default amqp091
one), as well as by queue type, which is something that many asked for a
really long time.

The most important aspect is that we can also see them by protocol AND
queue_type, which becomes very important for Streams, which have
different rules from regular queues (e.g. for example, consuming
messages is non-destructive, and deep queue backlogs - think billions of
messages - are normal). Alerting and consumer scaling due to deep
backlogs will now work correctly, as we can distinguish between regular
queues & streams.

This has gone through a few cycles, with @mkuratczyk & @dcorbacho
covering most of the ground. @dcorbacho had most of this in
https://github.com/rabbitmq/rabbitmq-server/pull/3045, but the main
branch went through a few changes in the meantime. Rather than resolving
all the conflicts, and then making the necessary changes, we (@gerhard +
@kjnilsson) took all learnings and started re-applying a lot of the
existing code from #3045. We are confident in this approach and would
like to see it through. We continued working on this with @dumbbell, and
the most important changes are captured in
https://github.com/rabbitmq/seshat/pull/1.

We expose these global counters in rabbitmq_prometheus via a new
collector. We don't want to keep modifying the existing collector, which
grew really complex in parts, especially since we introduced
aggregation, but start with a new namespace, `rabbitmq_global_`, and
continue building on top of it. The idea is to build in parallel, and
slowly transition to the new metrics, because semantically the changes
are too big since streams, and we have been discussing protocol-specific
metrics with @kjnilsson, which makes me think that this approach is
least disruptive and... simple.

While at this, we removed redundant empty return value handling in the
channel. The function called no longer returns this.

Also removed all DONE / TODO & other comments - we'll handle them when
the time comes, no need to leave TODO reminders.

Pairs @kjnilsson @dcorbacho @dumbbell
(this is multiple commits squashed into one)

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-22 14:14:21 +01:00
Philip Kuryloski 70cb8147b2 Default all `rabbitmq_integration_suite` to flaky in bazel
Most tests that can start rabbitmq nodes have some chance of
flaking. Rather than chase individual flakes for now, this commit
changes the default (though it can still be overriden, as is the case
for config_scheme_SUITE in many places, since I have yet to see that
particular suite flake).
2021-06-21 16:10:38 +02:00
Philip Kuryloski 30f9a95b9f Add dialyze for remaning tier-1 plugins 2021-06-01 10:19:10 +02:00
Philip Kuryloski a3dbdecb8c Mark //deps/rabbitmq_prometheus:rabbit_prometheus_http_SUITE flaky 2021-05-21 18:32:20 +02:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Philip Kuryloski e6df6615e1 Futher bazel file refactoring and deduplication 2021-05-11 16:15:33 +02:00
Philip Kuryloski b39cd342f2 buildifier formatting 2021-05-05 14:20:38 +02:00
Philip Kuryloski d61aa69039 Add rabbitmq_prometheus to bazel 2021-05-05 11:43:03 +02:00
Gerhard Lazu 1e5708b0c5
Fix Grafana dashboards when importing from URL
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-03-22 19:27:13 +00:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
kjnilsson 52f745dcde Update rabbitmq-components.mk
use v1.x branch of ra
2021-03-18 15:14:40 +00:00
Loïc Hoguin d5e3bdd623
Add ADDITIONAL_PLUGINS variable
This allows including additional applications or third party
plugins when creating a release, running the broker locally,
or just building from the top-level Makefile.

To include Looking Glass in a release, for example:

$ make package-generic-unix ADDITIONAL_PLUGINS="looking_glass"

A Docker image can then be built using this release and will
contain Looking Glass:

$ make docker-image

Beware macOS users! Applications such as Looking Glass include
NIFs. NIFs must be compiled in the right environment. If you
are building a Docker image then make sure to build the NIF
on Linux! In the two steps above, this corresponds to Step 1.

To run the broker with Looking Glass available:

$ make run-broker ADDITIONAL_PLUGINS="looking_glass"

This commit also moves Looking Glass dependency information
into rabbitmq-components.mk so it is available at all times.
2021-03-12 12:29:28 +01:00
Jean-Sébastien Pédron cdcf602749
Switch from Lager to the new Erlang Logger API for logging
The configuration remains the same for the end-user. The only exception
is the log root directory: it is now set through the `log_root`
application env. variable in `rabbit`. People using the Cuttlefish-based
configuration file are not affected by this exception.

The main change is how the logging facility is configured. It now
happens in `rabbit_prelaunch_logging`. The `rabbit_lager` module is
removed.

The supported outputs remain the same: the console, text files, the
`amq.rabbitmq.log` exchange and syslog.

The message text format slightly changed: the timestamp is more precise
(now to the microsecond) and the level can be abbreviated to always be
4-character long to align all messages and improve readability. Here is
an example:

    2021-03-03 10:22:30.377392+01:00 [dbug] <0.229.0> == Prelaunch DONE ==
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Starting RabbitMQ 3.8.10+115.g071f3fb on Erlang 23.2.5
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Licensed under the MPL 2.0. Website: https://rabbitmq.com

The example above also shows that multiline messages are supported and
each line is prepended with the same prefix (the timestamp, the level
and the Erlang process PID).

JSON is also supported as a message format and now for any outputs.
Indeed, it is possible to use it with e.g. syslog or the exchange. Here
is an example of a JSON-formatted message sent to syslog:

    Mar  3 11:23:06 localhost rabbitmq-server[27908] <0.229.0> - {"time":"2021-03-03T11:23:06.998466+01:00","level":"notice","msg":"Logging: configured log handlers are now ACTIVE","meta":{"domain":"rabbitmq.prelaunch","file":"src/rabbit_prelaunch_logging.erl","gl":"<0.228.0>","line":311,"mfa":["rabbit_prelaunch_logging","configure_logger",1],"pid":"<0.229.0>"}}

For quick testing, the values accepted by the `$RABBITMQ_LOGS`
environment variables were extended:
  * `-` still means stdout
  * `-stderr` means stderr
  * `syslog:` means syslog on localhost
  * `exchange:` means logging to `amq.rabbitmq.log`

`$RABBITMQ_LOG` was also extended. It now accepts a `+json` modifier (in
addition to the existing `+color` one). With that modifier, messages are
formatted as JSON intead of plain text.

The `rabbitmqctl rotate_logs` command is deprecated. The reason is
Logger does not expose a function to force log rotation. However, it
will detect when a file was rotated by an external tool.

From a developer point of view, the old `rabbit_log*` API remains
supported, though it is now deprecated. It is implemented as regular
modules: there is no `parse_transform` involved anymore.

In the code, it is recommended to use the new Logger macros. For
instance, `?LOG_INFO(Format, Args)`. If possible, messages should be
augmented with some metadata. For instance (note the map after the
message):

    ?LOG_NOTICE("Logging: switching to configured handler(s); following "
                "messages may not be visible in this log output",
                #{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),

Domains in Erlang Logger parlance are the way to categorize messages.
Some predefined domains, matching previous categories, are currently
defined in `rabbit_common/include/logging.hrl` or headers in the
relevant plugins for plugin-specific categories.

At this point, very few messages have been converted from the old
`rabbit_log*` API to the new macros. It can be done gradually when
working on a particular module or logging.

The Erlang builtin console/file handler, `logger_std_h`, has been forked
because it lacks date-based file rotation. The configuration of
date-based rotation is identical to Lager. Once the dust has settled for
this feature, the goal is to submit it upstream for inclusion in Erlang.
The forked module is calld `rabbit_logger_std_h` and is based
`logger_std_h` in Erlang 23.0.
2021-03-11 15:17:36 +01:00
Michael Klishin f6e8320fc9
Merge branch 'otp-24-ranch' 2021-03-10 07:37:51 +03:00
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01:00
Gerhard Lazu c18ad7a5b6
Fix colors for node names that include digits in Grafana dashboards
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-03-08 13:19:14 +00:00
Michael Klishin b6c4831e75
Bump Lager to 3.9.1 2021-03-04 04:36:39 +03:00
Loïc Hoguin 66ac1bf5e9
Bump observer_cli to 1.6.1
More responsive when the system is overloaded with file calls.
2021-03-01 21:55:27 +03:00
Michael Klishin 8fe3df9343
Upgrade Lager to 3.9.0 for OTP 24 compatibility
`lager_util:expand_path/1` use changes are
due to erlang-lager/lager#540
2021-02-26 00:52:15 +03:00
Michael Klishin 17b082abeb
Merge pull request #2843 from rabbitmq/consumer-capacity
Rename consumer_utilisation to consumer_capacity
2021-02-25 16:17:09 +03:00
Michael Klishin 7ea841f5e9
Consumer utilization => consumer capacity in Prometheus metrics
the original metric is kept around for backwards compatibility.
2021-02-24 22:10:52 +03:00
Michael Klishin f73e851f9c
Bump observer_cli to 1.6.0 2021-02-24 12:53:55 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
Gerhard Lazu 6adb2449b4
Add inet_tcp_metrics Grafana dashboard & cluster example
It uses the commercial edition of RabbitMQ, requires a valid Tanzu
Network account.  Learn more: https://rabbitmq.com/tanzu

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-02-05 12:50:32 +00:00
Arnaud Cogoluègnes b921ac11a8
Merge pull request #2712 from rabbitmq/rabbitmq-stream-prometheus
Add stream prometheus plugin
2021-01-27 16:46:37 +01:00
Gerhard Lazu f3f3e8aae9
Always show aggregated auth_attempts, add detailed when per object enabled
The metrics have different names now, so we can't end up with duplicate TYPEs.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-01-22 16:38:44 +00:00
Gerhard Lazu 5a6e3f235b
Single auth_attempts declarations when per-object metrics enabled
Closes #2740

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-01-22 11:36:42 +00:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Michael Klishin 24cab9881a
Prometheus metric collector: correct wording in labels 2021-01-20 20:53:46 +03:00
Gerhard Lazu 0ce95075ef
Bump all Grafana dashboards dep versions to latest
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-01-18 18:59:11 +00:00
David Ansari 377a933f4c
Filter Grafana dashboards by namespace (#2719)
So that clusters with the same rabbitmq_cluster name in different K8s namespaces don't clash

Namespace filter comes first, because the order of the layers is namespace -> cluster -> node

Tested with the latest 3.9.0 dev build

We had to account for plugin changes from .ez to directories & the management.load_definitions deprecation which would prevent a node from booting (fixed in 07a0dd7438). This commit didn't make it through the 3.9.x pipeline yet, so there is no 3.9.0 dev build with this fix yet. The simplest fix is to drop `management.` from the load_definitions config.

The next manual step is to generate all dashboards using e.g. `make RabbitMQ-Overview.json > ~/Downloads/RabbitMQ-Overview.json` and upload them to https://grafana.com/orgs/rabbitmq

Great contribution @ansd, thank you 👏🏻
2021-01-18 18:45:05 +00:00
Arnaud Cogoluègnes bf72683eb2
Add stream prometheus plugin 2021-01-11 16:49:56 +01:00
Arnaud Cogoluègnes 224e9914b2
Merge branch 'master' into rabbitmq-stream-management 2020-12-04 10:26:42 +01:00
Mirah Gary b403fe9b73
Remove unused code line. 2020-11-26 10:45:53 +01:00
Mirah Gary fe9881687c
Change per-object endpoint to `/metrics/per-object`.
This conforms with other http endpoints.
2020-11-26 10:35:26 +01:00
Michal Kuratczyk 37486d45a4
Document `/metrics/per_object` endpoint.
[#175264017]

Signed-off-by: Mirah Gary <mgary@pivotal.io>
2020-11-25 12:14:14 +01:00
dcorbacho 32e9314fb7 Deleted unnecessary pattern
:registry matches any registry, it's only a variable
2020-11-25 10:59:06 +00:00
Michal Kuratczyk 8b8a66cf0b Add /metrics/per_object endpoint
Regardless of the value of `return_per_object_metrics`, this endpoint
always returns per-object metrics. This allows scraping both endpoints
at different intervals or scraping per-object metrics only during
debugging.

Co-authored-by: Mirah Gary <mgary@vmware.com>
2020-11-19 18:00:42 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Jean-Sébastien Pédron 47686ee1f0
Remove unused .github directories
They were valid until the switch to the "monorepository" when everything
was merged into a single Git repository.
2020-11-17 13:33:16 +01:00
Gerhard Lazu 4e31a176c9 Upgrade RabbitMQ Overview dashboard to Grafana 7
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-11-13 12:55:05 +00:00
Gerhard Lazu 530de03e38 Merge pull request #61 from rabbitmq/grafana-publisher-fix
Prevent non-zero publisher count in Grafana when aggregating metrics
2020-11-13 12:45:33 +00:00
Gerhard Lazu 3f6f54eb02 Bump Grafana, Prometheus & Node Exporter to latest
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-11-13 12:15:06 +00:00
Connor Rogers 5b9f77a5f2 Prevent non-zero publisher count when aggregating metrics
In the case where there are 0 channels (and as such 0 publishers), the
dashboard reports there are actually `n` publishers in an `n`-node
cluster. This changes the calculation of publishers to be number of
channels (which is always known) minus the number of consumers (which is
always known).
2020-11-12 15:26:39 +00:00
Arnaud Cogoluègnes 2d769fa86b Update rabbitmq-components.mk 2020-11-03 14:27:46 +01:00
Michael Klishin 3cc9bf7cfd Update rabbitmq-components.mk 2020-10-21 12:55:42 +03:00
dcorbacho 4874e52d19 Use auth attempt detailed metrics only when reporting per object 2020-09-23 13:06:56 +01:00
dcorbacho 3ff27c4815 Add auth attempt metrics 2020-08-28 15:45:47 +01:00
Luke Bakken f056a48d92 Update rabbitmq-components.mk 2020-08-04 08:41:49 -07:00
Jean-Sébastien Pédron 41078dae30 Update rabbitmq-components.mk 2020-07-30 12:06:56 +02:00
Luke Bakken 9fdf0b25da Update rabbitmq-components.mk 2020-07-29 10:02:05 -07:00
dcorbacho 5eedc2cf14 Update erlang.mk 2020-07-21 14:33:17 +01:00
Michael Klishin 25a2a3cabc Update rabbitmq-components.mk 2020-07-21 13:12:52 +03:00
Michael Klishin 535ddc9388 Update rabbitmq-components.mk 2020-07-21 03:45:11 +03:00
dcorbacho 7e9ecfab5f Revert drop of Exhibit B on MPL 2.0 2020-07-20 17:02:50 +01:00
dcorbacho 3355a68e4c Update LICENSE 2020-07-20 12:00:41 +01:00
Gerhard Lazu 8f7953438e Fix Erlang cookie when running with Docker Compose on Windows
Context:
9452cf179b (commitcomment-40660523)

Thanks @wainwrightmark!

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-07-17 10:28:14 +01:00
Michael Klishin 898a46d7bc Switch to MPL2 2020-07-14 16:42:52 +03:00
Gerhard Lazu 9452cf179b Mount .erlang.cookie file
Context: we want to move away from environment variables and use either
config files or env files (such as the rabbitmq-env.conf).

Since .erlang.cookie is neither, the official RabbitMQ Docker image
handles this by writing the value from the RABBITMQ_ERLANG_COOKIE env
var into the file if it does not exist. The problem is that if this file
exists, and the value is different from the RABBITMQ_ERLANG_COOKIE env
var, CLI tools will not be able to communicate with the rabbit node, as
described here: https://github.com/rabbitmq/rabbitmq-cli/issues/443

The only gotcha is that this file must be owned by the user, and
privileges should not be too open (git should have captured this). If
not, RabbitMQ will fail to boot. This is somewhat similar to how OpenSSH
reacts when private key permissions are too open.

re https://github.com/docker-library/rabbitmq/pull/422#issuecomment-650074731

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-07-01 17:07:16 +01:00
Luke Bakken 2b66cd1228 Add GitHub templates 2020-06-30 08:37:24 -07:00
Gerhard Lazu c0f28afab1 Add erlang_vm_dist_node_queue_size_bytes to metrics.md
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-24 16:36:04 +01:00
Gerhard Lazu b28f6e64ba Fix metric name & description in zdbbl graph, Erlang Distribution
open http://localhost:3000/dashboards # select Erlang-Distribution
    e > Metrics; General > Description # when on Data buffered in the distribution links queue
    Save Dashboard > Export > +Export for sharing externally > Save to file
    pwd
    /Users/gerhard/github.com/rabbitmq/3.9.x/deps/rabbitmq_prometheus
    vimdiff docker/grafana/dashboards/Erlang-Distribution.json ~/Downloads/Erlang-Distribution*.json

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-24 16:36:04 +01:00
Gerhard Lazu e18c8b5e9f Fix specific_erlang_metrics_present_test
pwd
    /Users/gerhard/github.com/rabbitmq/3.9.x/deps/rabbitmq_prometheus
    rm -fr ../prometheus.erl
    make tests

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-24 16:34:53 +01:00
Gerhard Lazu cab99c29f0 Add failing test for erlang_vm_dist_node_queue_size_bytes
Have to force prometheus.erl to a version that does not have this
feature, otherwise the test would succeed.

    pwd
    /Users/gerhard/github.com/rabbitmq/3.9.x/deps/rabbitmq_prometheus
    rm -fr ../prometheus.erl
    make tests
    open logs/index.html

Pull request content:

  Expose & visualise distribution buffer busy limit - zdbbl

  > This will be closed after TGIR S01E04 gets recorded.
  > The goal is to demonstrate how to do this, and then let an external contributor have a go.

  Before this patch, the **Data buffered in the distribution links queue** graph was empty.

  This is what that graph looks like after this gets applied:

  ![image](https://user-images.githubusercontent.com/3342/80223464-3bf28580-8640-11ea-8851-8f33f1c4fd4f.png)

  ## References

  - [RabbitMQ Runtime Tuning - Inter-node Communication Buffer Size](https://www.rabbitmq.com/runtime.html#distribution-buffer)
  - [erl +zdbbl](https://erlang.org/doc/man/erl.html#+zdbbl)

  Fixes #39

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-24 16:34:48 +01:00
Jean-Sébastien Pédron 46d37b081d Update erlang.mk 2020-06-23 17:14:52 +02:00
Gerhard Lazu a6f6244c85 Build Docker image from latest 3.9 dev release + this PR
Update OTP to latest stable, 23.0.2

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-18 11:52:16 +01:00
Gerhard Lazu db2f70753e Add tests for product name & version
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-06-18 11:51:47 +01:00
Jean-Sébastien Pédron 618a235bfd prometheus_rabbitmq_core_metrics_collector: Expose product info
They are the product name & version. They are added at the beginning of
`rabbitmq_build_info` if they are set. If they are not, the content of
`rabbitmq_build_info` is the same as before.
2020-06-17 15:24:13 +02:00
Michael Klishin 8a278bca30 Update rabbitmq-components.mk 2020-06-10 19:51:20 +03:00
Michael Klishin 1d3c78d389 Update README.md 2020-06-03 03:32:59 +03:00
Gerhard Lazu 850a30653d Use Grafana 6.7.2 schema defaults in Erlang-Distribution
This will make future diffs smaller

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
(cherry picked from commit e1a08d6ae752181177cbcc411219a8dd780359d2)
2020-04-27 15:22:01 +01:00
Gerhard Lazu d0bdccc130 Improve make targets & aliases
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
(cherry picked from commit b57c01265ec2b6b27c9cf43785d7101b1ec76648)
2020-04-27 15:21:50 +01:00
Gerhard Lazu dff69adad6 Add GitHub code owners
https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-27 14:28:20 +01:00
Gerhard Lazu 246d7b6f35 Add build & Grafana dashboard badges
Hard-coding number of dashboards, because there is no API for
https://grafana.com/orgs/rabbitmq/dashboards, and setting up our own
JSON endpoint to return this information would be overkill.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-25 00:51:50 +01:00
Gerhard Lazu cba6aa06f4 Fix test that was made to fail on purpose
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-25 00:14:05 +01:00
Gerhard Lazu 9cc33c571d Print the response body by default
Makes is easier to spot why a match failed.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-25 00:06:32 +01:00
Gerhard Lazu aa199bc5fe Run tests on GitHub Actions on every push
Supporting n-1 Erlang/OTP versions: v21 & v22 and taking into account
RabbitMQ's Erlang Version Requirements:
https://www.rabbitmq.com/which-erlang.html

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-24 23:42:09 +01:00
Gerhard Lazu eca19f7dd9 Bump versions across a number of deps
- RabbitMQ latest 3.9 dev build
- OpenSSL - https://github.com/docker-library/rabbitmq/pull/403
- OTP, PerfTest, Prometheus & Grafana latest GA

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
(cherry picked from commit b25b4e897337d97edbf6a826b0f12d20ea7cf914)
2020-04-22 18:12:21 +01:00
Gerhard Lazu 56468b27e8 Merge pull request #34 from Aakcht/grafana_change_color_labelling
change regex for node/color labelling scheme in grafana dashboards
2020-04-22 18:01:01 +01:00
Michael Klishin 1f7beddf22 Simplify 2020-04-19 02:51:37 +03:00
Michael Klishin 7dae6ce57a Explain that the endpoint is at /metrics
References rabbitmq/discussions#96
2020-04-19 02:50:32 +03:00
Luke Bakken 658dd34e91 Handle the combination of TLS options and cowboy_opts 2020-04-15 15:38:24 +00:00
Luke Bakken 8efd9a1d63 Return TLS listener correctly
`ssl_opts` must be used so that TLS options are recognized.

Fixes #800

Also ensure TLS port is set.
2020-04-15 00:15:25 +00:00
aakcht 729dd14f9b Color labelling grafana fix 2020-04-14 18:20:04 +04:00
Jean-Sébastien Pédron 636c3f78dc Update copyright (year 2020) 2020-03-10 16:42:08 +01:00
Gerhard Lazu 88231d0922 Update rabbitmq-components.mk 2020-03-06 09:19:19 +00:00
Gerhard Lazu 5a15d0b5a5 Update erlang.mk 2020-03-06 09:18:12 +00:00
Gerhard Lazu 1222018e50 Make Erlang-Memory-Allocators dashboard look better on light
Use the latest Grafana schema improvements to simplify the dahsboard
definition.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-24 13:21:46 +00:00
Gerhard Lazu 8d40bf85a2 Bump Prometheus & Grafana to latest stable
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-24 12:45:13 +00:00
Gerhard Lazu 9c112b5718 Sum resident set size on Erlang-Memory-Allocators
Otherwise the singlestat panel will return a 'Only queries that return
single series/table is supported' error if the node changed some
properties, like the instance label because the IP changed.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-24 12:09:47 +00:00
Gerhard Lazu d64361658a Bump to latest unverified generic-unix 3.9 dev build
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-12 19:00:00 +00:00
Gerhard Lazu 3118473b78 Use unverified generic-unix build for the Docker image
Given that we test Linux distributions and upgrades after this artefact
is produced, it's quicker to get the latest RabbitMQ generic-unix dev
build into a Docker image without waiting on tests that are less
relevant & useful for the audience of this image.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-12 18:59:52 +00:00
Gerhard Lazu 8fb98a265f Update rabbitmq-components.mk 2020-02-11 15:31:47 +00:00
Gerhard Lazu 92ef32d022 Build image with latest RabbitMQ 3.9.0 dev + local
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-11 13:29:29 +00:00
Gerhard Lazu 19683fc2c9 Clean up NODES table on RabbitMQ-Overview
Hiding "all other" values stopped working since Grafana v6.6.1, need to
be explicit about which values should be hidden. Picked up a few other
changes from Grafana after Save JSON to file.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-11 13:26:20 +00:00
Gerhard Lazu dec54306c9 Use publisher confirms for Quorum Queue workload
It activates and extra graph on the RabbitMQ-Overview dashboard and
let's be honest - why use Quorum Queues if the workload didn't care
whether the broker received the message? They go together, seriously!

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-11 13:23:26 +00:00
Gerhard Lazu e7c997744d Improve config for returning metrics per object
Since metrics are now aggregated by default, it made more sense to use
the inverse meaning of disabling aggregation, and call it a positive and
explicit action: return_per_object_metrics.

Naming pair: @michaelklishin

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-11 13:08:00 +00:00
Gerhard Lazu 4622974d1b Bump Grafana & Prometheus to latest
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-10 17:50:13 +00:00
Gerhard Lazu c079459e9c Bump Docker image to latest RabbitMQ 3.9 dev
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-10 17:49:06 +00:00
dcorbacho 253ef8e827 Fix 0/0 and enable all tests 2020-02-07 17:08:10 +01:00
Gerhard Lazu 09b29057af Aggregate metrics by default
Having talked to @michaelklishin we've decided to enable metrics
aggregation by default so that RabbitMQ nodes with many objects serve
the same amount of metrics quickly rather than taking many seconds and
transferring many MBs of data on every scrape.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-07 15:19:30 +00:00
Gerhard Lazu e91e4ea32b Bump to latest RabbitMQ 3.9.0 dev build & Erlang/OTP v22.2.6
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-06 17:57:31 +00:00
Gerhard Lazu 11d676f3e1 Replace histogram type with gauge for raft_entry_commit_latency_seconds
We want to keep the same metric type regardless whether we aggregate or
don't. If we had used a histogram type, considering the ~12 buckets that
we added, it would have meant 12 extra metrics per queue which would
have resulted in an explosion of metrics. Keeping the gauge type and
aggregating latencies across all members.

re https://github.com/rabbitmq/rabbitmq-prometheus/pull/28

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-06 17:37:37 +00:00
Gerhard Lazu 8aa8d8aa3d Remove K8S config related to rabbitmq/rabbitmq-prometheus#24
Planning on redoing it differently

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-05 13:42:58 +00:00
Gerhard Lazu 8088a50e13 Merge pull request #28 from rabbitmq/metrics-aggregation
Option to aggregate channel, queue and connection metrics
2020-02-04 12:43:49 +00:00
Gerhard Lazu 851a2b974f Partially replicate the deployment mentioned in #24
https://github.com/rabbitmq/rabbitmq-prometheus/issues/24#issue-543780125

Before we can test the effectiveness of the fix in
https://github.com/rabbitmq/rabbitmq-prometheus/issues/26 against an
environment replica that this was initially reported in, we are missing
the load app deployment that would generate all the connections and queues.

It would be helpful to know whether
https://github.com/coreos/kube-prometheus was used for the
Prometheus & Grafana deployment.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-01-17 16:04:14 +00:00