Skip to content

Commit 729b31f

Browse files
Merge pull request #11942 from rabbitmq/mergify/bp/v4.0.x/pr-11940
Extract Prometheus extensions for Shovel and Federation into their own plugins (backport #11940)
2 parents 7ae3207 + 208aa1c commit 729b31f

37 files changed

+1682
-125
lines changed

.github/workflows/templates/test-mixed-versions.template.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ on:
2323
push:
2424
branches:
2525
- main
26-
- v3.12.x
27-
- v3.11.x
28-
- v3.10.x
29-
- v3.9.x
30-
- v3.8.x
26+
- v4.0.x
27+
- v3.13.x
3128
- bump-otp-*
3229
- bump-elixir-*
3330
- bump-rbe-*

.github/workflows/test-mixed-versions.yaml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ on:
33
push:
44
branches:
55
- main
6-
- v3.12.x
7-
- v3.11.x
8-
- v3.10.x
9-
- v3.9.x
10-
- v3.8.x
6+
- v4.0.x
7+
- v3.13.x
118
- bump-otp-*
129
- bump-elixir-*
1310
- bump-rbe-*
@@ -617,6 +614,24 @@ jobs:
617614
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
618615
plugin: rabbitmq_federation_management
619616
secrets: inherit
617+
test-rabbitmq_federation_prometheus-mixed:
618+
needs:
619+
- check-workflow
620+
- test-rabbit-0-mixed
621+
- test-rabbit-1-mixed
622+
- test-rabbit-2-mixed
623+
- test-rabbit-3-mixed
624+
- test-rabbit-4-mixed
625+
- test-rabbit-5-mixed
626+
- test-rabbit-6-mixed
627+
- test-rabbit-7-mixed
628+
- test-rabbit-8-mixed
629+
- test-rabbit-9-mixed
630+
uses: ./.github/workflows/test-plugin-mixed.yaml
631+
with:
632+
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
633+
plugin: rabbitmq_federation_prometheus
634+
secrets: inherit
620635
test-rabbitmq_jms_topic_exchange-mixed:
621636
needs:
622637
- check-workflow
@@ -905,6 +920,24 @@ jobs:
905920
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
906921
plugin: rabbitmq_shovel_management
907922
secrets: inherit
923+
test-rabbitmq_shovel_prometheus-mixed:
924+
needs:
925+
- check-workflow
926+
- test-rabbit-0-mixed
927+
- test-rabbit-1-mixed
928+
- test-rabbit-2-mixed
929+
- test-rabbit-3-mixed
930+
- test-rabbit-4-mixed
931+
- test-rabbit-5-mixed
932+
- test-rabbit-6-mixed
933+
- test-rabbit-7-mixed
934+
- test-rabbit-8-mixed
935+
- test-rabbit-9-mixed
936+
uses: ./.github/workflows/test-plugin-mixed.yaml
937+
with:
938+
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
939+
plugin: rabbitmq_shovel_prometheus
940+
secrets: inherit
908941
test-rabbitmq_stomp-mixed:
909942
needs:
910943
- check-workflow
@@ -1126,6 +1159,7 @@ jobs:
11261159
- test-rabbitmq_event_exchange-mixed
11271160
- test-rabbitmq_federation-mixed
11281161
- test-rabbitmq_federation_management-mixed
1162+
- test-rabbitmq_federation_prometheus-mixed
11291163
- test-rabbitmq_jms_topic_exchange-mixed
11301164
- test-rabbitmq_management-mixed
11311165
- test-rabbitmq_management_agent-mixed
@@ -1142,6 +1176,7 @@ jobs:
11421176
- test-rabbitmq_sharding-mixed
11431177
- test-rabbitmq_shovel-mixed
11441178
- test-rabbitmq_shovel_management-mixed
1179+
- test-rabbitmq_shovel_prometheus-mixed
11451180
- test-rabbitmq_stomp-mixed
11461181
- test-rabbitmq_stream-mixed
11471182
- test-rabbitmq_stream_management-mixed

.github/workflows/test.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,24 @@ jobs:
554554
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
555555
plugin: rabbitmq_federation_management
556556
secrets: inherit
557+
test-rabbitmq_federation_prometheus:
558+
needs:
559+
- check-workflow
560+
- test-rabbit-0
561+
- test-rabbit-1
562+
- test-rabbit-2
563+
- test-rabbit-3
564+
- test-rabbit-4
565+
- test-rabbit-5
566+
- test-rabbit-6
567+
- test-rabbit-7
568+
- test-rabbit-8
569+
- test-rabbit-9
570+
uses: ./.github/workflows/test-plugin.yaml
571+
with:
572+
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
573+
plugin: rabbitmq_federation_prometheus
574+
secrets: inherit
557575
test-rabbitmq_jms_topic_exchange:
558576
needs:
559577
- check-workflow
@@ -842,6 +860,24 @@ jobs:
842860
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
843861
plugin: rabbitmq_shovel_management
844862
secrets: inherit
863+
test-rabbitmq_shovel_prometheus:
864+
needs:
865+
- check-workflow
866+
- test-rabbit-0
867+
- test-rabbit-1
868+
- test-rabbit-2
869+
- test-rabbit-3
870+
- test-rabbit-4
871+
- test-rabbit-5
872+
- test-rabbit-6
873+
- test-rabbit-7
874+
- test-rabbit-8
875+
- test-rabbit-9
876+
uses: ./.github/workflows/test-plugin.yaml
877+
with:
878+
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
879+
plugin: rabbitmq_shovel_prometheus
880+
secrets: inherit
845881
test-rabbitmq_stomp:
846882
needs:
847883
- check-workflow
@@ -1063,6 +1099,7 @@ jobs:
10631099
- test-rabbitmq_event_exchange
10641100
- test-rabbitmq_federation
10651101
- test-rabbitmq_federation_management
1102+
- test-rabbitmq_federation_prometheus
10661103
- test-rabbitmq_jms_topic_exchange
10671104
- test-rabbitmq_management
10681105
- test-rabbitmq_management_agent
@@ -1079,6 +1116,7 @@ jobs:
10791116
- test-rabbitmq_sharding
10801117
- test-rabbitmq_shovel
10811118
- test-rabbitmq_shovel_management
1119+
- test-rabbitmq_shovel_prometheus
10821120
- test-rabbitmq_stomp
10831121
- test-rabbitmq_stream
10841122
- test-rabbitmq_stream_management

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ elvis
4848
!/deps/rabbitmq_event_exchange/
4949
!/deps/rabbitmq_federation/
5050
!/deps/rabbitmq_federation_management/
51+
!/deps/rabbitmq_federation_prometheus/
5152
!/deps/rabbitmq_jms_topic_exchange/
5253
!/deps/rabbitmq_management/
5354
!/deps/rabbitmq_management_agent/
@@ -64,6 +65,7 @@ elvis
6465
!/deps/rabbitmq_sharding/
6566
!/deps/rabbitmq_shovel/
6667
!/deps/rabbitmq_shovel_management/
68+
!/deps/rabbitmq_shovel_prometheus/
6769
!/deps/rabbitmq_stomp/
6870
!/deps/rabbitmq_stream/
6971
!/deps/rabbitmq_stream_common/

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ TIER1_PLUGINS := \
594594
rabbitmq_event_exchange \
595595
rabbitmq_federation \
596596
rabbitmq_federation_management \
597+
rabbitmq_federation_prometheus \
597598
rabbitmq_jms_topic_exchange \
598599
rabbitmq_management \
599600
rabbitmq_management_agent \
@@ -610,6 +611,7 @@ TIER1_PLUGINS := \
610611
rabbitmq_sharding \
611612
rabbitmq_shovel \
612613
rabbitmq_shovel_management \
614+
rabbitmq_shovel_prometheus \
613615
rabbitmq_stomp \
614616
rabbitmq_stream \
615617
rabbitmq_stream_management \
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
load("@rules_erlang//:eunit2.bzl", "eunit")
2+
load("@rules_erlang//:xref2.bzl", "xref")
3+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
4+
load("//:rabbitmq_home.bzl", "rabbitmq_home")
5+
load("//:rabbitmq_run.bzl", "rabbitmq_run")
6+
load(
7+
"//:rabbitmq.bzl",
8+
"BROKER_VERSION_REQUIREMENTS_ANY",
9+
"RABBITMQ_DIALYZER_OPTS",
10+
"assert_suites",
11+
"rabbitmq_app",
12+
"rabbitmq_integration_suite",
13+
)
14+
load(
15+
":app.bzl",
16+
"all_beam_files",
17+
"all_srcs",
18+
"all_test_beam_files",
19+
"test_suite_beam_files",
20+
)
21+
22+
APP_NAME = "rabbitmq_federation_prometheus"
23+
24+
APP_DESCRIPTION = "Prometheus extension for the Federation plugin"
25+
26+
APP_ENV = """[
27+
]"""
28+
29+
all_srcs(name = "all_srcs")
30+
31+
all_beam_files(name = "all_beam_files")
32+
33+
all_test_beam_files(name = "all_test_beam_files")
34+
35+
test_suite_beam_files(name = "test_suite_beam_files")
36+
37+
# gazelle:erlang_app_extra_app crypto
38+
39+
# gazelle:erlang_app_dep rabbit
40+
# gazelle:erlang_app_dep rabbitmq_prometheus
41+
42+
# gazelle:erlang_app_dep_exclude prometheus
43+
44+
rabbitmq_app(
45+
name = "erlang_app",
46+
srcs = [":all_srcs"],
47+
hdrs = [":public_hdrs"],
48+
app_description = APP_DESCRIPTION,
49+
app_env = APP_ENV,
50+
app_extra_keys = BROKER_VERSION_REQUIREMENTS_ANY,
51+
app_module = "rabbit_federation_prometheus_app",
52+
app_name = APP_NAME,
53+
beam_files = [":beam_files"],
54+
extra_apps = [
55+
"crypto",
56+
],
57+
license_files = [":license_files"],
58+
priv = [":priv"],
59+
deps = [
60+
"//deps/rabbit:erlang_app",
61+
"//deps/rabbitmq_federation:erlang_app",
62+
"//deps/rabbitmq_prometheus:erlang_app",
63+
],
64+
)
65+
66+
xref(
67+
name = "xref",
68+
target = ":erlang_app",
69+
)
70+
71+
plt(
72+
name = "deps_plt",
73+
for_target = ":erlang_app",
74+
ignore_warnings = True,
75+
libs = ["@rules_elixir//elixir"], # keep
76+
plt = "//:base_plt",
77+
)
78+
79+
dialyze(
80+
name = "dialyze",
81+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
82+
plt = ":deps_plt",
83+
target = ":erlang_app",
84+
)
85+
86+
eunit(
87+
name = "eunit",
88+
target = ":test_erlang_app",
89+
)
90+
91+
rabbitmq_home(
92+
name = "broker-for-tests-home",
93+
plugins = [
94+
"//deps/rabbit:erlang_app",
95+
":erlang_app",
96+
],
97+
)
98+
99+
rabbitmq_run(
100+
name = "rabbitmq-for-tests-run",
101+
home = ":broker-for-tests-home",
102+
)
103+
104+
rabbitmq_integration_suite(
105+
name = "prometheus_rabbitmq_federation_collector_SUITE",
106+
size = "small",
107+
additional_beam = [
108+
],
109+
)
110+
111+
assert_suites()
112+
113+
alias(
114+
name = "rabbitmq_federation_prometheus",
115+
actual = ":erlang_app",
116+
visibility = ["//visibility:public"],
117+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CODE_OF_CONDUCT.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CONTRIBUTING.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This package is licensed under the MPL 2.0. For the MPL 2.0, please see LICENSE-MPL-RabbitMQ.

0 commit comments

Comments
 (0)