Skip to content

Commit 2b8d9ea

Browse files
jmckulkdsessler7
authored andcommitted
Filter out metrics that we care about using grep
1 parent 34dfe0a commit 2b8d9ea

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

testing/kuttl/e2e/otel-logging-and-metrics/05-assert-pgbouncer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ commands:
2121
}
2222
2323
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
24-
curl --insecure --silent http://localhost:9187/metrics)
24+
curl --insecure --silent http://localhost:9187/metrics | grep 'ccp_pgbouncer_clients_wait_seconds')
2525
{ contains "${scrape_metrics}" 'ccp_pgbouncer_clients_wait_seconds'; } || {
2626
retry "pgbouncer metric not found"
2727
exit 1

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ commands:
3838
}
3939
4040
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
41-
curl --insecure --silent http://localhost:9187/metrics)
41+
curl --insecure --silent http://localhost:9187/metrics | grep \
42+
-e 'ccp_connection_stats_active' \
43+
-e 'patroni_postgres_running' \
44+
-e 'ccp_database_size_bytes')
4245
{ contains "${scrape_metrics}" 'ccp_connection_stats_active'; } || {
4346
retry "5 second metric not found"
4447
exit 1

testing/kuttl/e2e/otel-logging-and-metrics/12-assert-per-db-queries.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ commands:
2121
}
2222
2323
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
24-
curl --insecure --silent http://localhost:9187/metrics)
24+
curl --insecure --silent http://localhost:9187/metrics | grep 'ccp_table_size_bytes')
2525
{ contains "${scrape_metrics}" 'ccp_table_size_bytes{dbname="pikachu"'; } || {
2626
retry "ccp_table_size_bytes not found for pikachu"
2727
exit 1

testing/kuttl/e2e/otel-logging-and-metrics/14-assert-per-db-queries-for-multiple-targets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ commands:
2121
}
2222
2323
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
24-
curl --insecure --silent http://localhost:9187/metrics)
24+
curl --insecure --silent http://localhost:9187/metrics | grep 'ccp_table_size_bytes')
2525
{ contains "${scrape_metrics}" 'ccp_table_size_bytes{dbname="pikachu"'; } || {
2626
retry "ccp_table_size_bytes not found for pikachu"
2727
exit 1

testing/kuttl/e2e/otel-logging-and-metrics/18-assert-custom-queries-per-db.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ commands:
2323
}
2424
2525
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
26-
curl --insecure --silent http://localhost:9187/metrics)
26+
curl --insecure --silent http://localhost:9187/metrics | grep 'ccp_table_size_bytes')
2727
{ contains "${scrape_metrics}" 'ccp_table_size_bytes_1{dbname="pikachu"'; } || {
2828
retry "custom metric not found for pikachu db"
2929
exit 1

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ commands:
2323
}
2424
2525
scrape_metrics=$(kubectl exec "${pod}" -c collector -n "${NAMESPACE}" -- \
26-
curl --insecure --silent http://localhost:9187/metrics)
26+
curl --insecure --silent http://localhost:9187/metrics | grep \
27+
-e 'ccp_connection_stats_active' \
28+
-e 'patroni_postgres_running')
2729
{ contains "${scrape_metrics}" 'ccp_connection_stats_active'; } || {
2830
retry "5 second metric not found"
2931
exit 1

0 commit comments

Comments
 (0)