diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 5959e300821..4676a4d5f28 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -61,7 +61,7 @@ jobs: GOBENCH_USERNAME: ${{ secrets.GOBENCH_USERNAME }} GOBENCH_HOST: ${{ secrets.GOBENCH_HOST }} # temporarily override to get faster feedback - BENCHMARK_WARMUP_TIME: 5m + BENCHMARK_WARMUP_TIME: 1m BENCHMARK_COUNT: 2 BENCHMARK_TIME: 1m steps: @@ -142,6 +142,10 @@ jobs: if: ${{ inputs.benchmarkAgents != '' }} run: make run-benchmark + - name: Cat APM Server logs + if: failure() + run: make cat-apm-server-logs + # Results are only indexed and uploaded if the run happens on the main branch. - name: Index benchmarks result diff --git a/systemtest/cmd/moxy/main.go b/systemtest/cmd/moxy/main.go index cf3c4cebd88..c1d546dbd66 100644 --- a/systemtest/cmd/moxy/main.go +++ b/systemtest/cmd/moxy/main.go @@ -58,7 +58,7 @@ func handler(logger *zap.Logger, username, password string) http.Handler { zap.String("actual", string(actualAuth)), zap.String("expected", expectedAuth), ) - // w.WriteHeader(http.StatusUnauthorized) + w.WriteHeader(http.StatusUnauthorized) return } switch r.URL.Path { diff --git a/testing/benchmark/Makefile b/testing/benchmark/Makefile index 560e3567300..5f3df05df4e 100644 --- a/testing/benchmark/Makefile +++ b/testing/benchmark/Makefile @@ -30,6 +30,7 @@ SSH_USER ?= ec2-user SSH_OPTS ?= -o LogLevel=ERROR -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=10 SSH_KEY ?= ~/.ssh/id_rsa_terraform WORKER_IP = $(shell terraform output -raw public_ip) +APM_SERVER_IP = $(shell terraform output -raw apm_server_ip) SHELL = /bin/bash .SHELLFLAGS = -o pipefail -c @@ -134,6 +135,10 @@ _default-gobench-vars: $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),elasticsearch_zone_count=$(shell echo var.elasticsearch_zone_count | terraform console | tr -d '"')) $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),build_sha=$(shell curl -sL -H "Authorization: Bearer $(shell terraform output -raw apm_secret_token )" $(shell terraform output -raw apm_server_url ) | jq -r '.build_sha')) +.PHONY: cat-apm-server-logs +cat-apm-server-logs: + @ssh $(SSH_OPTS) -i $(SSH_KEY) $(SSH_USER)@$(APM_SERVER_IP) "cat /var/log/apm-server/*" + $(SSH_KEY): @ssh-keygen -t rsa -b 4096 -C "$(USER)@elastic.co" -N "" -f $(SSH_KEY) diff --git a/testing/benchmark/outputs.tf b/testing/benchmark/outputs.tf index 079aea7e934..247ad4fa2df 100644 --- a/testing/benchmark/outputs.tf +++ b/testing/benchmark/outputs.tf @@ -37,6 +37,12 @@ output "apm_server_url" { sensitive = true } +output "apm_server_ip" { + value = var.run_standalone ? module.standalone_apm_server[0].apm_server_ip : "" + description = "The APM Server EC2 IP address" + sensitive = true +} + output "admin_console_url" { value = !var.run_standalone ? module.ec_deployment[0].admin_console_url : "" description = "The admin console URL" diff --git a/testing/infra/terraform/modules/standalone_apm_server/outputs.tf b/testing/infra/terraform/modules/standalone_apm_server/outputs.tf index 7491343d314..138e496e592 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/outputs.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/outputs.tf @@ -8,3 +8,8 @@ output "apm_server_url" { value = "http://${aws_instance.apm.public_ip}:${local.apm_port}" description = "The APM Server URL" } + +output "apm_server_ip" { + value = aws_instance.apm.public_ip + description = "The APM Server EC2 IP address" +}