Commit Graph

113 Commits

Author SHA1 Message Date
Alexey Lebedeff 46df4f1689 Update makefiles/bazel to reflect CT helpers repo merge-in 2021-09-30 10:48:11 +02:00
Loïc Hoguin 43d40231b9
Upgrade to Observer CLI 1.7.1
Previous version was not working on Windows due to a crash.
2021-09-21 13:49:58 +02:00
Loïc Hoguin d327e8a7cb
Update Ranch to 2.1.0 2021-09-09 12:37:52 +02:00
Philip Kuryloski 81c7464b06 Use prometheus 4.8.1 from hex.pm 2021-07-09 09:49:59 +02:00
Gerhard Lazu fae836f1c6
Remove rabbitmq_stream_prometheus plugin
All these metrics, except publishers & consumers, are handled by
rabbitmq_global_metrics, so we currently have duplicates. As I started
removing these, I realised that tests were written in Java - why not
Erlang? - and they seemed way too complicated for what was needed. After
the new rabbitmq_global_metrics, we are left with 2 metrics, and all the
extra code simply doesn't justify them. I am proposing that we add them to
rabbit_global_counters as gauges. Let's discuss @dcorbacho @acogoluegnes

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2021-06-22 14:14:26 +01:00
Arnaud Cogoluègnes 1ee34a4cb4
Merge pull request #3101 from rabbitmq/stream-common-library
Stream common library
2021-06-15 10:28:20 +02:00
Michael Klishin 300196ea4e
Second attempt at upgrading JSX to 3.1 2021-06-12 08:03:18 +08:00
dcorbacho 38f474688f Stream common library 2021-06-11 17:24:00 +02:00
Michael Klishin 2da9d1c2d6
Revert "Bump jsx to 3.1.0"
This reverts commit 179e1b8d39.

This new version is not entirely backwards compatible and our
test suites will need adapting.
2021-06-11 11:32:12 +03:00
Michael Klishin e186f51187
Bump observer_cli to 1.6.2 2021-06-11 04:20:33 +03:00
Michael Klishin 179e1b8d39
Bump jsx to 3.1.0 2021-06-11 04:20:17 +03:00
Michael Klishin 8adcfcda6c
Merge pull request #2909 from rabbitmq/ra-systems
Ra systems
2021-03-23 12:49:09 +03:00
Philip Kuryloski a025ff71ea Only fetch the monorepo once in rabbitmq-components.mk
when the rabbitmq-components.mk file is used in non-monorepo
plugins. Note that with this change all deps of type git_rmq-subfolder
must target the same branches for it to behave properly.
2021-03-23 08:45:21 +01:00
kjnilsson f6f02a5d2d
ra systems wip 2021-03-22 21:44:15 +03: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
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01: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 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
Arnaud Cogoluègnes bf72683eb2
Add stream prometheus plugin 2021-01-11 16:49:56 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Philip Kuryloski e32b93b3e6 Add support for bringing topic branches into the monorepo
Once the monorepo is built, from within it one can run `make
fetch-topic-branch-${TOPIC_BRANCH}` then `make
topic-branch-${TOPIC_BRANCH}` to rebase the commits from all the
sources back onto the monorepo
2020-11-13 14:41:22 +01:00
Philip Kuryloski 44b77e8b1e Monorepo GitHub Actions
Add GitHub Actions workflows for Erlang/OTP 22.3 & 23.0.

The workflows run tests for each component that is now part of this
repo, with test suite parallelization specifically for the rabbit
erlang application.
2020-11-13 14:41:22 +01:00
Arnaud Cogoluègnes 617cd5270c
Update rabbitmq-components.mk 2020-11-03 14:27:48 +01:00
Michael Klishin 262196a94c
Update rabbitmq-components.mk 2020-10-21 12:55:44 +03:00
Luke Bakken 0d428233fb
Update rabbitmq-components.mk 2020-08-04 08:41:49 -07:00
Jean-Sébastien Pédron 1b91df82db
Update rabbitmq-components.mk 2020-07-30 12:06:57 +02:00
Luke Bakken 5ebab992f7
Update rabbitmq-components.mk 2020-07-29 10:02:05 -07:00
Michael Klishin 9e1858e57c
Update rabbitmq-components.mk 2020-07-21 13:12:54 +03:00
Michael Klishin 1dc42a1366
Update rabbitmq-components.mk 2020-07-21 03:40:06 +03:00
Michael Klishin d8b5cedbc7
Sync rabbitmq-components.mk 2020-06-10 11:37:24 +03:00
Gerhard Lazu 626ead739b
Update rabbitmq-components.mk 2020-03-06 09:19:20 +00:00
Gerhard Lazu 86fca9fd16
Update rabbitmq-components.mk 2020-02-11 15:31:48 +00:00
Jean-Sébastien Pédron c15b08b113
Update rabbitmq-components.mk 2019-12-12 13:14:57 +01:00
kjnilsson 0b593fa297 Update rabbitmq-components.mk 2019-09-13 10:24:31 +01:00
kjnilsson ac481826a9 Update rabbitmq-components.mk 2019-09-04 10:31:10 +01:00
Michael Klishin 4a50ec6070
Update rabbitmq-components.mk 2019-08-11 01:48:06 +10:00
Michael Klishin a462fb9d41
Update rabbitmq-components.mk 2019-08-01 17:13:27 +03:00
Arnaud Cogoluègnes 9c2e710807
Update rabbitmq-components.mk 2019-07-09 16:06:09 +02:00
Jean-Sébastien Pédron 08114497a2
Update rabbitmq-components.mk 2019-06-28 16:05:40 +02:00
Gerhard Lazu 20425a856f
Update rabbitmq-components.mk 2019-06-03 02:23:46 +01:00
Jean-Sébastien Pédron d63f51dea7
Update rabbitmq-components.mk 2019-05-17 15:17:27 +02:00
Michael Klishin 3b69281ca2
Update rabbitmq-components.mk 2019-05-17 08:37:11 +03:00
Michael Klishin 4df196ffc2
Update rabbitmq-components.mk 2019-05-14 11:51:02 +03:00
Michael Klishin 1545def6b5
Update rabbitmq-components.mk 2019-05-13 16:46:25 +03:00