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/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 diff --git a/tests/soak/run.sh b/tests/soak/run.sh index 47826e590..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])') @@ -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 - -