diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 4676a4d5f28..6407d19b69d 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -142,18 +142,18 @@ jobs: if: ${{ inputs.benchmarkAgents != '' }} run: make run-benchmark - - name: Cat APM Server logs - if: failure() + - name: Cat standalone server logs + if: ${{ inputs.runStandalone && 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 - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' run: make index-benchmark-results - name: Download PNG - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' run: >- ${{ github.workspace }}/.ci/scripts/download-png-from-kibana.sh ${{ secrets.KIBANA_BENCH_ENDPOINT }} @@ -162,7 +162,7 @@ jobs: $PNG_REPORT_FILE - name: Upload PNG - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: name: kibana-png-report @@ -170,7 +170,7 @@ jobs: if-no-files-found: error - name: Upload PNG to AWS S3 - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' id: s3-upload-png env: AWS_DEFAULT_REGION: us-east-1 @@ -180,7 +180,7 @@ jobs: echo "png_report_url=https://elastic-apm-server-benchmark-reports.s3.amazonaws.com/${DEST_NAME}" >> "$GITHUB_OUTPUT" - name: Upload benchmark result - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: name: benchmark-result diff --git a/systemtest/benchtest/profiles.go b/systemtest/benchtest/profiles.go index 2214c7e764e..e3dd240df44 100644 --- a/systemtest/benchtest/profiles.go +++ b/systemtest/benchtest/profiles.go @@ -88,12 +88,7 @@ func (p *profiles) recordCPU() error { if benchConfig.CPUProfile == "" { return nil } - // Limit the CPU profile collection to static 1 minute interval per a benchmark. - // Otherwise the profile will be too heavy and over influenced by the "longest" benchmark. - duration := time.Minute - if duration > benchConfig.Benchtime { - duration = benchConfig.Benchtime - } + duration := benchConfig.Benchtime profile, err := fetchProfile("/debug/pprof/profile", duration) if err != nil { return fmt.Errorf("failed to fetch CPU profile: %w", err) diff --git a/systemtest/cmd/moxy/main.go b/systemtest/cmd/moxy/main.go index 557da1bf432..1c026b557f8 100644 --- a/systemtest/cmd/moxy/main.go +++ b/systemtest/cmd/moxy/main.go @@ -58,7 +58,6 @@ func handler(logger *zap.Logger, username, password string) http.Handler { w.Header().Set("X-Elastic-Product", "Elasticsearch") switch r.URL.Path { case "/": - // MIS doesn't use this route, but apm-server checks for cluster_uuid w.Write([]byte(`{ "name": "instance-0000000001", "cluster_name": "eca3b3c3bbee4816bb92f82184e328dd", diff --git a/testing/benchmark/Makefile b/testing/benchmark/Makefile index 5f3df05df4e..0c034355375 100644 --- a/testing/benchmark/Makefile +++ b/testing/benchmark/Makefile @@ -9,6 +9,8 @@ MOXY_GOARCH ?= amd64 APM_SERVER_GOOS ?= linux APM_SERVER_GOARCH ?= amd64 +RUN_STANDALONE ?= false + TFVARS_SOURCE ?= terraform.tfvars.example BENCHMARK_WARMUP_TIME ?= 5m @@ -127,6 +129,12 @@ index-benchmark-results: _default-gobench-vars .PHONY: _default-gobench-vars _default-gobench-vars: +ifeq ($(RUN_STANDALONE),true) + $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_size=$(shell echo var.standalone_apm_server_instance_size | terraform console | tr -d '"')) + $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),moxy_size=$(shell echo var.standalone_moxy_instance_size | terraform console | tr -d '"')) + $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),build_sha=$(shell git rev-parse HEAD)) + $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),bench_mode=standalone) +else # TODO(marclop) Update code below to use a foor loop, rather than copying the lines. $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_size=$(shell echo var.apm_server_size | terraform console | tr -d '"')) $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),elasticsearch_size=$(shell echo var.elasticsearch_size | terraform console | tr -d '"')) @@ -134,6 +142,8 @@ _default-gobench-vars: $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_zone_count=$(shell echo var.apm_server_zone_count | terraform console | tr -d '"')) $(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')) + $(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),bench_mode=cloud) +endif .PHONY: cat-apm-server-logs cat-apm-server-logs: diff --git a/testing/benchmark/main.tf b/testing/benchmark/main.tf index 68f3f9bfbeb..984ae7375c7 100644 --- a/testing/benchmark/main.tf +++ b/testing/benchmark/main.tf @@ -35,9 +35,7 @@ module "tags" { project = startswith(var.user_name, "benchci") ? "benchmarks" : var.user_name } -provider "ec" { - apikey = "aaa" -} +provider "ec" {} provider "aws" { region = var.worker_region diff --git a/testing/benchmark/variables.tf b/testing/benchmark/variables.tf index e08406aaffa..c658e63aab2 100644 --- a/testing/benchmark/variables.tf +++ b/testing/benchmark/variables.tf @@ -1,13 +1,12 @@ ## General configuration variable "user_name" { - default = "test-kostya-vpc-bench-apm" description = "Required username to use for prefixes" type = string } variable "run_standalone" { - default = true + default = false description = "If set run benchmarks against standalone APM Server conneted to moxy" type = bool } diff --git a/testing/infra/terraform/modules/standalone_apm_server/main.tf b/testing/infra/terraform/modules/standalone_apm_server/main.tf index c638a040808..a43f81b36da 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/main.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/main.tf @@ -6,7 +6,7 @@ locals { "debian-10-arm64" = "136693071363" # debian "debian-11-arm64" = "136693071363" # debian "amzn2-ami-kernel-5.10" = "137112412989" # amazon - "amzn2-ami-hvm-*-x86_64-ebs" = "137112412989" #amazon + "amzn2-ami-hvm-*-x86_64-ebs" = "137112412989" # amazon "al2023-ami-2023" = "137112412989" # amazon "RHEL-7" = "309956199498" # Red Hat "RHEL-8" = "309956199498" # Red Hat