diff --git a/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml b/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml index 226bcce3cd..60e5fe5694 100644 --- a/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml +++ b/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml @@ -4,6 +4,8 @@ commands: # First, check that all containers in the instance pod are ready. # Then, grab the collector metrics output and check that a postgres # metric is present, as well as a patroni metric. +# Then use psql to run a bad command in the database to get an error +# and ensure that there is a postgres log to capture. # Then, check the collector logs for patroni, and postgres logs. # Finally, ensure the monitoring user exists and is configured. - script: | @@ -35,6 +37,8 @@ commands: exit 1 } + kubectl exec "${pod}" -n "${NAMESPACE}" -- psql -c "SHOW DOES_NOT_EXIST;" 2>/dev/null || true + logs=$(kubectl logs "${pod}" --namespace "${NAMESPACE}" -c collector | grep InstrumentationScope) { contains "${logs}" 'InstrumentationScope patroni'; } || { retry "patroni logs not found"