From 9c7476e2fb8616afcb5b63aad0c8f356c62184e4 Mon Sep 17 00:00:00 2001 From: Anchit Jain Date: Thu, 23 Jan 2025 13:19:54 +0530 Subject: [PATCH 1/3] Add OTEL config --- tests/soak/otel-config.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/soak/otel-config.yaml diff --git a/tests/soak/otel-config.yaml b/tests/soak/otel-config.yaml new file mode 100644 index 000000000..1c5e5e4fa --- /dev/null +++ b/tests/soak/otel-config.yaml @@ -0,0 +1,36 @@ +receivers: + otlp: + protocols: + grpc: + +processors: + batch: + send_batch_max_size: 100 + send_batch_size: 10 + timeout: 10s + +exporters: + datadog: + api: + site: datadoghq.com + key: KEY + logs: + enabled: true + metrics: + histograms: + mode: distributions + send_aggregation_metrics: true + +service: + telemetry: + logs: + level: "debug" + pipelines: + metrics: + receivers: [otlp] + processors: [batch] + exporters: [datadog] + logs: + receivers: [otlp] + processors: [batch] + exporters: [datadog] \ No newline at end of file From 1f5046ee221eb795d22e2ca33de9945acd2f39f2 Mon Sep 17 00:00:00 2001 From: Anchit Jain Date: Wed, 29 Jan 2025 15:32:32 +0530 Subject: [PATCH 2/3] Changes to run with EC2 --- tests/soak/ccloud.config.example | 9 +++++++++ tests/soak/run.sh | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/soak/ccloud.config.example diff --git a/tests/soak/ccloud.config.example b/tests/soak/ccloud.config.example new file mode 100644 index 000000000..85e0b9c04 --- /dev/null +++ b/tests/soak/ccloud.config.example @@ -0,0 +1,9 @@ +bootstrap.servers= +sasl.mechanisms=PLAIN +security.protocol=SASL_SSL +sasl.username= +sasl.password= +enable.idempotence=true +debug=eos,generic,broker,security,consumer +linger.ms=2 +compression.type=lz4 diff --git a/tests/soak/run.sh b/tests/soak/run.sh index 47826e590..bd7f4aace 100755 --- a/tests/soak/run.sh +++ b/tests/soak/run.sh @@ -11,12 +11,20 @@ if [[ -z $librdkafka_version ]]; then exit 1 fi +if [[ -z $STY ]]; then + echo "This script should be run from inside a screen session" + exit 1 +fi + set -u topic="pysoak-$TESTID-$librdkafka_version" +logfile="${topic}.log.bz2" + echo "Starting soak client using topic $topic" set +x -time opentelemetry-instrument confluent-kafka-python/tests/soak/soakclient.py -i $TESTID -t $topic -r 80 -f confluent-kafka-python/ccloud.config 2>&1 +time confluent-kafka-python/tests/soak/soakclient.py -t $topic -r 80 -f confluent-kafka-python/ccloud.config 2>&1 \ + | tee /dev/stderr | bzip2 > $logfile ret=$? echo "Python client exited with status $ret" exit $ret From 6b72e5e8b55c5c18ac2082bf3676444089c9ef2f Mon Sep 17 00:00:00 2001 From: Anchit Jain Date: Fri, 28 Feb 2025 16:37:16 +0530 Subject: [PATCH 3/3] Update run.sh --- tests/soak/run.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/soak/run.sh b/tests/soak/run.sh index bd7f4aace..e90cffa2d 100755 --- a/tests/soak/run.sh +++ b/tests/soak/run.sh @@ -1,7 +1,5 @@ #!/bin/bash -# -set -e source venv/bin/activate librdkafka_version=$(python3 -c 'from confluent_kafka import libversion; print(libversion()[0])') @@ -11,22 +9,25 @@ if [[ -z $librdkafka_version ]]; then exit 1 fi -if [[ -z $STY ]]; then - echo "This script should be run from inside a screen session" - exit 1 -fi - set -u topic="pysoak-$TESTID-$librdkafka_version" -logfile="${topic}.log.bz2" - - -echo "Starting soak client using topic $topic" +logfile="${TESTID}.log.bz2" +export HOSTNAME=$(hostname) +echo "Starting soak client using topic $topic. Logging to $logfile." set +x -time confluent-kafka-python/tests/soak/soakclient.py -t $topic -r 80 -f confluent-kafka-python/ccloud.config 2>&1 \ - | tee /dev/stderr | bzip2 > $logfile +# Ignore SIGINT in children (inherited) +trap "" SIGINT +time opentelemetry-instrument confluent-kafka-python/tests/soak/soakclient.py -i $TESTID -t $topic -r 80 -f $1 |& tee /dev/tty | bzip2 > $logfile & +PID=$! +# On SIGINT kill only the first process of the pipe +onsigint() { + # List children of $PID only + ps --ppid $PID -f | grep soakclient.py | grep -v grep | awk '{print $2}' | xargs kill +} +trap onsigint SIGINT +# Await the result +wait $PID ret=$? echo "Python client exited with status $ret" +echo "Ending soak client using topic $topic. Logging to $logfile." exit $ret - -