Skip to content

Commit

Permalink
add apm-server mock and tear down
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 26, 2023
1 parent 60733ec commit 88fda88
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .buildkite/scripts/opentelemetry-benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env bash
set -eo pipefail

CONTAINER_NAME=mock-apm-server

function cleanup {
echo "--- Tear down the environment"
MOCK_APM_SERVER=$(docker ps | grep $CONTAINER_NAME | awk '{print $1}')
docker stop $MOCK_APM_SERVER
docker rm $MOCK_APM_SERVER
}

trap cleanup EXIT

echo "--- Download the latest elastic-agent.zip"
# run earlier so gh can use the current github repository.
run_id=$(gh run list --branch main --status success --workflow main.yml -L 1 --json databaseId --jq '.[].databaseId')
Expand All @@ -10,6 +21,13 @@ ELASTIC_SNAPSHOT_JAR=$(ls -1 elastic-apm-agent-*.jar)
ELASTIC_SNAPSHOT_JAR_FILE="$(pwd)/$ELASTIC_SNAPSHOT_JAR"
echo "$ELASTIC_SNAPSHOT_JAR_FILE has been downloaded."

echo "--- Download the latest elastic-agent.zip"
git clone https://github.com/elastic/apm-mutating-webhook.git
pushd apm-mutating-webhook/test/mock
docker build -t $CONTAINER_NAME .
docker run -dp 127.0.0.1:8027:8027 $CONTAINER_NAME
popd

echo "--- Build opentelemetry-java-instrumentation"
git clone https://github.com/open-telemetry/opentelemetry-java-instrumentation.git --depth 1 --branch main
cd opentelemetry-java-instrumentation/
Expand Down

0 comments on commit 88fda88

Please sign in to comment.