Skip to content

Run soak tests from EC2 #1908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/soak/ccloud.config.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bootstrap.servers=<add your bootstraps here>
sasl.mechanisms=PLAIN
security.protocol=SASL_SSL
sasl.username=<your ccloud access key>
sasl.password=<your ccloud secret>
enable.idempotence=true
debug=eos,generic,broker,security,consumer
linger.ms=2
compression.type=lz4
36 changes: 36 additions & 0 deletions tests/soak/otel-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Preview

Copilot AI Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Datadog exporter API key is set to a placeholder value ('KEY'). Replace it with the actual key or use a secure method (e.g., environment variable) to load this value in production.

Suggested change
key: KEY
key: ${DD_API_KEY}

Copilot uses AI. Check for mistakes.

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]
23 changes: 16 additions & 7 deletions tests/soak/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
#

set -e
source venv/bin/activate

librdkafka_version=$(python3 -c 'from confluent_kafka import libversion; print(libversion()[0])')
Expand All @@ -13,12 +11,23 @@ fi

set -u
topic="pysoak-$TESTID-$librdkafka_version"

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 opentelemetry-instrument confluent-kafka-python/tests/soak/soakclient.py -i $TESTID -t $topic -r 80 -f confluent-kafka-python/ccloud.config 2>&1
# 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