Skip to content

Commit 2455bed

Browse files
committed
OTel kuttl test fix: add bad psql command to force an error and ensure there will be a postgres log to capture.
1 parent 91d8657 commit 2455bed

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ commands:
44
# First, check that all containers in the instance pod are ready.
55
# Then, grab the collector metrics output and check that a postgres
66
# metric is present, as well as a patroni metric.
7+
# Then use psql to run a bad command in the database to get an error
8+
# and ensure that there is a postgres log to capture.
79
# Then, check the collector logs for patroni, and postgres logs.
810
# Finally, ensure the monitoring user exists and is configured.
911
- script: |
@@ -35,6 +37,8 @@ commands:
3537
exit 1
3638
}
3739
40+
kubectl exec "${pod}" -n "${NAMESPACE}" -- psql -c "SHOW DOES_NOT_EXIST;" 2>/dev/null || true
41+
3842
logs=$(kubectl logs "${pod}" --namespace "${NAMESPACE}" -c collector | grep InstrumentationScope)
3943
{ contains "${logs}" 'InstrumentationScope patroni'; } || {
4044
retry "patroni logs not found"

0 commit comments

Comments
 (0)