Skip to content

Commit 4fb5ed9

Browse files
committed
Expose the metrics port
1 parent 9a2895d commit 4fb5ed9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/kamal/cli/proxy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def boot_config(subcommand)
4040
boot_options = [
4141
*(KAMAL.config.proxy_publish_args(options[:http_port], options[:https_port], options[:publish_host_ip]) if options[:publish]),
4242
*(KAMAL.config.proxy_logging_args(options[:log_max_size])),
43+
*("--expose=#{options[:metrics_port]}" if options[:metrics_port]),
4344
*options[:docker_options].map { |option| "--#{option}" }
4445
]
4546

test/cli/proxy_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class CliProxyTest < CliTestCase
372372
run_command("boot_config", "set", "--metrics_port", "9000", "--debug", "true").tap do |output|
373373
%w[ 1.1.1.1 1.1.1.2 ].each do |host|
374374
assert_match "Running /usr/bin/env mkdir -p .kamal/proxy on #{host}", output
375-
assert_match "Running /usr/bin/env rm .kamal/proxy/options on #{host}", output
375+
assert_match "Uploading \"--publish 80:80 --publish 443:443 --log-opt max-size=10m --expose=9000\" to .kamal/proxy/options on #{host}", output
376376
assert_match "Running /usr/bin/env rm .kamal/proxy/image on #{host}", output
377377
assert_match "Running /usr/bin/env rm .kamal/proxy/image_version on #{host}", output
378378
assert_match "Uploading \"kamal-proxy run --debug --metrics-port \\\"9000\\\"\" to .kamal/proxy/run_command on #{host}", output
@@ -383,7 +383,7 @@ class CliProxyTest < CliTestCase
383383
test "boot_config set all" do
384384
run_command("boot_config", "set", "--docker_options", "label=foo=bar", "--registry", "myreg", "--repository", "myrepo", "--image_version", "0.9.9", "--metrics_port", "9000", "--debug", "true").tap do |output|
385385
%w[ 1.1.1.1 1.1.1.2 ].each do |host|
386-
assert_match "Uploading \"--publish 80:80 --publish 443:443 --log-opt max-size=10m --label=foo=bar\" to .kamal/proxy/options on #{host}", output
386+
assert_match "Uploading \"--publish 80:80 --publish 443:443 --log-opt max-size=10m --expose=9000 --label=foo=bar\" to .kamal/proxy/options on #{host}", output
387387
assert_match "Uploading \"myreg/myrepo/kamal-proxy\" to .kamal/proxy/image on #{host}", output
388388
assert_match "Uploading \"0.9.9\" to .kamal/proxy/image_version on #{host}", output
389389
assert_match "Uploading \"kamal-proxy run --debug --metrics-port \\\"9000\\\"\" to .kamal/proxy/run_command on #{host}", output

0 commit comments

Comments
 (0)