diff --git a/examples/docker/kafka-oauth-strimzi/kafka/Dockerfile b/examples/docker/kafka-oauth-strimzi/kafka/Dockerfile index ba1b5ae1..c5f1b845 100644 --- a/examples/docker/kafka-oauth-strimzi/kafka/Dockerfile +++ b/examples/docker/kafka-oauth-strimzi/kafka/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/strimzi/kafka:0.39.0-kafka-3.6.1 +FROM quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 COPY libs/* /opt/kafka/libs/strimzi/ COPY config/* /opt/kafka/config/ diff --git a/examples/docker/kafka-oauth-strimzi/zookeeper/Dockerfile b/examples/docker/kafka-oauth-strimzi/zookeeper/Dockerfile index 633729fd..9fb41559 100644 --- a/examples/docker/kafka-oauth-strimzi/zookeeper/Dockerfile +++ b/examples/docker/kafka-oauth-strimzi/zookeeper/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/strimzi/kafka:0.39.0-kafka-3.6.1 +FROM quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 COPY start.sh /opt/kafka/ COPY simple_zk_config.sh /opt/kafka/ diff --git a/examples/docker/strimzi-kafka-image/Dockerfile b/examples/docker/strimzi-kafka-image/Dockerfile index 5856ab14..2cdc0c57 100644 --- a/examples/docker/strimzi-kafka-image/Dockerfile +++ b/examples/docker/strimzi-kafka-image/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/strimzi/kafka:0.44.0-kafka-3.8.0 +FROM quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 COPY target/libs/* /opt/kafka/libs/oauth/ ENV CLASSPATH /opt/kafka/libs/oauth/* diff --git a/examples/docker/strimzi-kafka-image/README.md b/examples/docker/strimzi-kafka-image/README.md index 5b07d409..896b2960 100644 --- a/examples/docker/strimzi-kafka-image/README.md +++ b/examples/docker/strimzi-kafka-image/README.md @@ -1,12 +1,12 @@ Strimzi Kafka Image with SNAPSHOT Strimzi Kafka OAuth ===================================================== -This is a build of a Docker image based on `quay.io/strimzi/kafka:0.44.0-kafka-3.8.0` with added most recently locally built SNAPSHOT version of Strimzi Kafka OAuth libraries. +This is a build of a Docker image based on `quay.io/strimzi/kafka:0.45.0-kafka-3.9.0` with added most recently locally built SNAPSHOT version of Strimzi Kafka OAuth libraries. This image adds a `/opt/kafka/libs/oauth` directory, and copies the latest jars for OAuth support in it. Then it puts this directory as the first directory on the classpath. -The result is that the specific version of Strimzi Kafka OAuth jars and their dependencies is used, because they appear on the classpath before the ones that are part of `quay.io/strimzi/kafka:0.44.0-kafka-3.8.0` which are located in the `/opt/kafka/libs` directory. +The result is that the specific version of Strimzi Kafka OAuth jars and their dependencies is used, because they appear on the classpath before the ones that are part of `quay.io/strimzi/kafka:0.45.0-kafka-3.9.0` which are located in the `/opt/kafka/libs` directory. Building @@ -14,7 +14,7 @@ Building Run `mvn install` then, use `docker build` to build the image: - docker build --output type=docker -t strimzi/kafka:latest-kafka-3.8.0-oauth . + docker build --output type=docker -t strimzi/kafka:latest-kafka-3.9.0-oauth . You can choose a different tag if you want. @@ -34,7 +34,7 @@ Validating You can start an interactive shell container and confirm that the jars are there. - docker run --rm -ti strimzi/kafka:latest-kafka-3.8.0-oauth /bin/sh + docker run --rm -ti strimzi/kafka:latest-kafka-3.9.0-oauth /bin/sh ls -la libs/oauth/ echo "$CLASSPATH" @@ -42,7 +42,7 @@ If you want to play around more within the container you may need to make yourse You achieve that by running the docker session as `root` user: - docker run --rm -ti --user root strimzi/kafka:latest-kafka-3.8.0-oauth /bin/sh + docker run --rm -ti --user root strimzi/kafka:latest-kafka-3.9.0-oauth /bin/sh @@ -63,12 +63,12 @@ For example if you are using Kubernetes Kind as described in [HACKING.md](../../ You need to retag the built image, so you can push it to Docker Registry: - docker tag strimzi/kafka:latest-kafka-3.8.0-oauth $DOCKER_REG/strimzi/kafka:latest-kafka-3.8.0-oauth - docker push $DOCKER_REG/strimzi/kafka:latest-kafka-3.8.0-oauth + docker tag strimzi/kafka:latest-kafka-3.9.0-oauth $DOCKER_REG/strimzi/kafka:latest-kafka-3.9.0-oauth + docker push $DOCKER_REG/strimzi/kafka:latest-kafka-3.9.0-oauth Actually, Kubernetes Kind supports an even simpler option how to make an image available to Kubernetes: - kind load docker-image strimzi/kafka:latest-kafka-3.8.0-oauth + kind load docker-image strimzi/kafka:latest-kafka-3.9.0-oauth If you're using minikube, you'll need to run `minikube docker-env` before building the image. @@ -79,9 +79,9 @@ Deploying In order for the operator to use your Kafka image, you have to replace the Kafka image coordinates in `packaging/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml` in your `strimzi-kafka-operator` project. -This image builds the kafka-3.8.0 replacement image, so we need to replace all occurrences where kafka-3.8.0 is referred to into the proper coordinates to our image: +This image builds the kafka-3.9.0 replacement image, so we need to replace all occurrences where kafka-3.9.0 is referred to into the proper coordinates to our image: - sed -Ei "s#quay.io/strimzi/kafka:latest-kafka-3.8.0#${DOCKER_REG}/strimzi/kafka:latest-kafka-3.8.0-oauth#" \ + sed -Ei "s#quay.io/strimzi/kafka:latest-kafka-3.9.0#${DOCKER_REG}/strimzi/kafka:latest-kafka-3.9.0-oauth#" \ packaging/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml @@ -94,11 +94,11 @@ You can now deploy Strimzi Kafka Operator following instructions in [HACKING.md] ## Via Helm -You can also run the operator via its Helm chart and set the `kafka.image.registry` property to your local registry. As an example, if you've built and tagged the image as `local.dev/strimzi/kafka:0.44.0-kafka-3.8.0`. You can run it using the operator as: +You can also run the operator via its Helm chart and set the `kafka.image.registry` property to your local registry. As an example, if you've built and tagged the image as `local.dev/strimzi/kafka:0.45.0-kafka-3.9.0`. You can run it using the operator as: helm repo add strimzi https://strimzi.io/charts/ --force-update helm upgrade -i -n strimzi strimzi strimzi/strimzi-kafka-operator \ - --version 0.44.0 \ + --version 0.45.0 \ --set watchNamespaces="{default}" \ --set generateNetworkPolicy=false \ --set kafka.image.registry="local.dev" \ diff --git a/examples/kubernetes/kafka-oauth-authz-metrics-client.yaml b/examples/kubernetes/kafka-oauth-authz-metrics-client.yaml index 7ffb0cae..47cbff40 100644 --- a/examples/kubernetes/kafka-oauth-authz-metrics-client.yaml +++ b/examples/kubernetes/kafka-oauth-authz-metrics-client.yaml @@ -40,7 +40,7 @@ metadata: spec: containers: - name: kafka-client-shell - image: quay.io/strimzi/kafka:latest-kafka-3.6.1 + image: quay.io/strimzi/kafka:latest-kafka-3.9.0 command: - /bin/sh env: diff --git a/testsuite/common/src/main/java/io/strimzi/testsuite/oauth/common/TestMetrics.java b/testsuite/common/src/main/java/io/strimzi/testsuite/oauth/common/TestMetrics.java index 3ddffebb..bef1d876 100644 --- a/testsuite/common/src/main/java/io/strimzi/testsuite/oauth/common/TestMetrics.java +++ b/testsuite/common/src/main/java/io/strimzi/testsuite/oauth/common/TestMetrics.java @@ -4,7 +4,6 @@ */ package io.strimzi.testsuite.oauth.common; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.strimzi.kafka.oauth.common.HttpUtil; import java.io.BufferedReader; @@ -82,33 +81,30 @@ void addMetric(String key, Map attrs, String value) { } /** - * Returns a value of a single metric matching the key and the attributes. + * Get the sum of values of all the metrics matching the key and the attributes *

* Attributes are specified as: name1, value1, name2, value2, ... * Not all attributes have to be specified, but those specified have to match (equality). * - * @param key Metric name to retrieve + * Different Strimzi Kafka images seem to expose internal metrics structures of type CumulativeSum and CumulativeCount differently. + * The later versions seem to add '_total' suffix, whereas the older versions don't. + * + * @param keyPrefix The key prefix for the key identifying the metric * @param attrs The attributes filter passed as attrName1, attrValue1, attrName2, attrValue2 ... - * @return Metric value as String + * @return The sum of the values of all the matching metrics as String */ - @SuppressFBWarnings("THROWS_METHOD_THROWS_RUNTIMEEXCEPTION") - public String getValue(String key, String... attrs) { - boolean match = false; - String result = null; + public BigDecimal getStartsWithValueSum(String keyPrefix, String... attrs) { + + BigDecimal result = new BigDecimal(0); next: for (MetricEntry entry: entries) { - if (entry.key.equals(key)) { + if (entry.key.startsWith(keyPrefix)) { for (int i = 0; i < attrs.length; i += 2) { if (!attrs[i + 1].equals(entry.attrs.get(attrs[i]))) { continue next; } } - if (!match) { - match = true; - result = entry.value; - } else { - throw new RuntimeException("More than one matching metric entry"); - } + result = result.add(new BigDecimal(entry.value)); } } return result; diff --git a/testsuite/docker/kafka/Dockerfile b/testsuite/docker/kafka/Dockerfile index 003abd73..39302b71 100644 --- a/testsuite/docker/kafka/Dockerfile +++ b/testsuite/docker/kafka/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/strimzi/kafka:0.39.0-kafka-3.6.1 +FROM quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 USER root RUN rm -rf /opt/kafka/libs/bcpkix* /opt/kafka/libs/bcprov* /opt/kafka/libs/keycloak* diff --git a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/BasicTests.java b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/BasicTests.java index 6f7619d5..c64c588d 100644 --- a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/BasicTests.java +++ b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/BasicTests.java @@ -98,10 +98,10 @@ void oauthMetricsClientAuth() throws Exception { TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); // Request for token from login callback handler - BigDecimal value = metrics.getValueSum("strimzi_oauth_authentication_requests_count", "context", "INTROSPECT", "kind", "client-auth", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_authentication_requests_count", "context", "INTROSPECT", "kind", "client-auth", "outcome", "success"); Assert.assertEquals("strimzi_oauth_authentication_requests_count for client-auth == 2", 2, value.intValue()); - value = metrics.getValueSum("strimzi_oauth_authentication_requests_totaltimems", "context", "INTROSPECT", "kind", "client-auth", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authentication_requests_totaltimems", "context", "INTROSPECT", "kind", "client-auth", "outcome", "success"); Assert.assertTrue("strimzi_oauth_authentication_requests_totaltimems for client-auth > 0.0", value.doubleValue() > 0.0); value = metrics.getValueSum("strimzi_oauth_authentication_requests_avgtimems", "context", "INTROSPECT", "kind", "client-auth", "outcome", "success"); @@ -114,10 +114,10 @@ void oauthMetricsClientAuth() throws Exception { Assert.assertTrue("strimzi_oauth_authentication_requests_maxtimems for client-auth > 0.0", value.doubleValue() > 0.0); // Authentication to keycloak to exchange clientId + cesret for an access token during login callback handler call - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECT", "kind", "client-auth", "host", authHostPort, "path", tokenPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECT", "kind", "client-auth", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertEquals("strimzi_oauth_http_requests_count for client-auth == 2", 2, value.intValue()); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECT", "kind", "client-auth", "host", authHostPort, "path", tokenPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECT", "kind", "client-auth", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for client-auth > 0.0", value.doubleValue() > 0.0); value = metrics.getValueSum("strimzi_oauth_http_requests_avgtimems", "context", "INTROSPECT", "kind", "client-auth", "host", authHostPort, "path", tokenPath, "outcome", "success"); @@ -177,17 +177,17 @@ void clientCredentialsWithJwtECDSAValidation() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "jwks", "host", authHostPort, "path", jwksPath, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "jwks", "host", authHostPort, "path", jwksPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_count for jwks > 0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "jwks", "host", authHostPort, "path", jwksPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "jwks", "host", authHostPort, "path", jwksPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "JWT", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "JWT", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 validations Assert.assertTrue("strimzi_oauth_validation_requests_count for jwks >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWT", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWT", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); } @@ -246,12 +246,12 @@ void clientCredentialsWithJwtRSAValidation() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAIN", "kind", "jwks", "host", authHostPort, "path", jwksPath, "mechanism", "OAUTHBEARER", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAIN", "kind", "jwks", "host", authHostPort, "path", jwksPath, "mechanism", "OAUTHBEARER", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_validation_requests_count for jwks >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAIN", "kind", "jwks", "host", authHostPort, "path", jwksPath, "mechanism", "OAUTHBEARER", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAIN", "kind", "jwks", "host", authHostPort, "path", jwksPath, "mechanism", "OAUTHBEARER", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); } @@ -304,11 +304,11 @@ void accessTokenWithIntrospection() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); // Inter-broker connection did some validation, producer and consumer did some Assert.assertTrue("strimzi_oauth_http_requests_count for introspect >= 5", value != null && value.intValue() >= 5); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for introspect > 0.0", value.doubleValue() > 0.0); } @@ -366,11 +366,11 @@ void refreshTokenWithIntrospection() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); // On top of the access token test, producer and consumer together did 4 requests Assert.assertTrue("strimzi_oauth_http_requests_count for introspect >= 9", value != null && value.intValue() >= 9); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "introspect", "host", authHostPort, "path", introspectPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for introspect > 0.0", value.doubleValue() > 0.0); } diff --git a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/OAuthOverPlainTests.java b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/OAuthOverPlainTests.java index cabb5c2f..0d04ae63 100644 --- a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/OAuthOverPlainTests.java +++ b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/OAuthOverPlainTests.java @@ -99,21 +99,21 @@ static void accessTokenOverPlainWithClientCredentialsDisabled() throws Exception // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAINWITHOUTCC", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAINWITHOUTCC", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_validation_requests_count for jwks >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAINWITHOUTCC", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAINWITHOUTCC", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "context", "JWTPLAINWITHOUTCC", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "context", "JWTPLAINWITHOUTCC", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); // There is no inter-broker connection on this listener // Validation did not require the broker authenticating in client's name, because the token was passed Assert.assertEquals("strimzi_oauth_http_requests_count for plain == 0", 0, value.intValue()); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAINWITHOUTCC", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAINWITHOUTCC", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); Assert.assertEquals("strimzi_oauth_http_requests_totaltimems for plain == 0.0", 0.0, value.doubleValue(), 0.0); } @@ -186,20 +186,20 @@ static void clientCredentialsOverPlainWithIntrospection() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_validation_requests_count for introspect >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_totaltimems for introspect > 0.0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_http_requests_count for plain >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for plain > 0.0", value.doubleValue() > 0.0); } @@ -252,17 +252,17 @@ static void accessTokenOverPlainWithIntrospection() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "INTROSPECTPLAIN", "kind", "introspect", "mechanism", "PLAIN", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 (on top of the previous test) Assert.assertTrue("strimzi_oauth_validation_requests_count for introspect >= 8", value != null && value.intValue() >= 8); - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_http_requests_count for plain >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for plain > 0.0", value.doubleValue() > 0.0); } @@ -316,20 +316,20 @@ static void clientCredentialsOverPlainWithJwt() throws Exception { // Check metrics TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAIN", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "context", "JWTPLAIN", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_validation_requests_count for jwt >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAIN", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "context", "JWTPLAIN", "kind", "jwks", "mechanism", "PLAIN", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_totaltimems for jwt > 0.0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); // There is no inter-broker connection on this listener, producer did 2 validations, and consumer also did 2 Assert.assertTrue("strimzi_oauth_http_requests_count for plain >= 4", value != null && value.intValue() >= 4); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "kind", "plain", "host", hostPort, "path", tokenEndpointPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for plain > 0.0", value.doubleValue() > 0.0); } diff --git a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MetricsTest.java b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MetricsTest.java index bbde2c7a..f6353aa6 100644 --- a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MetricsTest.java +++ b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MetricsTest.java @@ -23,17 +23,17 @@ public class MetricsTest { public static void doTest() throws Exception { TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "jwks", "host", AUTH_HOST_PORT, "path", JWKS_PATH, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "jwks", "host", AUTH_HOST_PORT, "path", JWKS_PATH, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_count for jwks > 0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "jwks", "host", AUTH_HOST_PORT, "path", JWKS_PATH, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "jwks", "host", AUTH_HOST_PORT, "path", JWKS_PATH, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); // Accross all the listeners there should only be 2 client authentication requests - those for inter-broker connection on JWT listener - value = metrics.getValueSum("strimzi_oauth_authentication_requests_count", "kind", "client-auth", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authentication_requests_count", "kind", "client-auth", "outcome", "success"); Assert.assertEquals("strimzi_oauth_authentication_requests_count for client-auth == 2", 2, value.intValue()); - value = metrics.getValueSum("strimzi_oauth_authentication_requests_totaltimems", "kind", "client-auth", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authentication_requests_totaltimems", "kind", "client-auth", "outcome", "success"); Assert.assertTrue("strimzi_oauth_authentication_requests_totaltimems for client-auth > 0.0", value.doubleValue() > 0.0); } @@ -43,14 +43,14 @@ public static void doTestValidationAndAuthorization() throws Exception { TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_validation_requests_count", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_count", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_count for jwks > 0", value.intValue() > 0); - value = metrics.getValueSum("strimzi_oauth_validation_requests_totaltimems", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_validation_requests_totaltimems", "kind", "jwks", "mechanism", "OAUTHBEARER", "outcome", "success"); Assert.assertTrue("strimzi_oauth_validation_requests_totaltimems for jwks > 0.0", value.doubleValue() > 0.0); // No 403 (no grants) responses in this test - value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "keycloak-authorization", "host", AUTH_HOST_PORT, "path", tokenPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "keycloak-authorization", "host", AUTH_HOST_PORT, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_count for keycloak-authorization > 0.0", value.doubleValue() > 0.0); } } diff --git a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MultiSaslTest.java b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MultiSaslTest.java index 7889d0dc..be9c38e9 100644 --- a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MultiSaslTest.java +++ b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/MultiSaslTest.java @@ -112,10 +112,10 @@ private void checkGrantsFetchCountDiff(int previousFetchGrantsCount) { private static void checkGrantsMetrics(String authHostPort, String tokenPath) throws IOException { TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_http_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_count for keycloak-authorization > 0", value.intValue() > 0); - value = metrics.getValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_http_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_http_requests_totaltimems for keycloak-authorization > 0", value.doubleValue() > 0.0); // There are 403 responses in Zookeeper mode, but not in KRaft mode @@ -131,16 +131,16 @@ private static void checkGrantsMetrics(String authHostPort, String tokenPath) th private static void checkAuthorizationRequestsMetrics(String authHostPort, String tokenPath) throws IOException { TestMetrics metrics = getPrometheusMetrics(URI.create("http://kafka:9404/metrics")); - BigDecimal value = metrics.getValueSum("strimzi_oauth_authorization_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); + BigDecimal value = metrics.getStartsWithValueSum("strimzi_oauth_authorization_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_authorization_requests_count for successful keycloak-authorization > 0", value.intValue() > 0); - value = metrics.getValueSum("strimzi_oauth_authorization_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authorization_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "success"); Assert.assertTrue("strimzi_oauth_authorization_requests_totaltimems for successful keycloak-authorization > 0", value.doubleValue() > 0.0); - value = metrics.getValueSum("strimzi_oauth_authorization_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "error"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authorization_requests_count", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "error"); Assert.assertEquals("strimzi_oauth_authorization_requests_count for failed keycloak-authorization == 0", 0, value.intValue()); - value = metrics.getValueSum("strimzi_oauth_authorization_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "error"); + value = metrics.getStartsWithValueSum("strimzi_oauth_authorization_requests_totaltimems", "kind", "keycloak-authorization", "host", authHostPort, "path", tokenPath, "outcome", "error"); Assert.assertEquals("strimzi_oauth_authorization_requests_totaltimems for failed keycloak-authorization == 0", 0.0, value.doubleValue(), 0.0); } diff --git a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricEntry.java b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricEntry.java index 618644f0..71f55804 100644 --- a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricEntry.java +++ b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricEntry.java @@ -16,4 +16,13 @@ public class MetricEntry { this.attrs = attrs; this.value = value; } + + @Override + public String toString() { + return "MetricEntry{" + + "key='" + key + '\'' + + ", attrs=" + attrs + + ", value='" + value + '\'' + + '}'; + } } diff --git a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/Metrics.java b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/Metrics.java index 3a4dbc5a..7f314dd2 100644 --- a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/Metrics.java +++ b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/Metrics.java @@ -45,6 +45,39 @@ String getValue(String key, String... attrs) { return result; } + /** + * Returns a value of a single metric matching the key prefix and the attributes. + * Not all attributes have to be specified. + * + * Different Strimzi Kafka images seem to expose internal metrics structures of type CumulativeSum and CumulativeCount differently. + * The later versions seem to add '_total' suffix, whereas the older versions don't. + * + * @param keyPrefix The key prefix for the key identifying the metric + * @param attrs The attributes filter passed as [attrName1, attrValue1, ... attrNameN, attrValueN] + * @return Metric value as String + */ + String getValueStartsWith(String keyPrefix, String... attrs) { + boolean match = false; + String result = null; + next: + for (MetricEntry entry : entries) { + if (entry.key.startsWith(keyPrefix)) { + for (int i = 0; i < attrs.length; i += 2) { + if (!attrs[i + 1].equals(entry.attrs.get(attrs[i]))) { + continue next; + } + } + if (!match) { + match = true; + result = entry.value; + } else { + throw new RuntimeException("More than one matching metric entry"); + } + } + } + return result; + } + /** * Get the sum of values of all the matching metrics * @@ -72,4 +105,9 @@ String getValueSum(String key, String... attrs) { static String quoted(String value) { return "\\\"" + value + "\\\""; } + + @Override + public String toString() { + return Metrics.class.getName() + "@" + System.identityHashCode(this) + " entries=" + entries; + } } diff --git a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricsTest.java b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricsTest.java index 6c0a50e1..9ce4abb6 100644 --- a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricsTest.java +++ b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/mockoauth/metrics/MetricsTest.java @@ -130,7 +130,7 @@ private void testInternalServerErrors() throws IOException, InterruptedException // We should not see any 503 errors yet because of more TLS errors due to CERT_TWO being used - String value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); + String value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); Assert.assertNull("There should be no 503 errors", value); // Switch mockoauth auth server back to using cert no. 1 changeAuthServerMode("server", "mode_cert_one_on"); @@ -140,11 +140,11 @@ private void testInternalServerErrors() throws IOException, InterruptedException // We should see some 503 errors - value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some 503 errors", new BigDecimal(value).doubleValue() > 0.0); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "http", "status", "503"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some 503 errors", new BigDecimal(value).doubleValue() > 0.0); } @@ -159,11 +159,11 @@ private void testExpiredCert() throws IOException, InterruptedException { // We should see some TLS errors - String value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "tls"); + String value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "tls"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some TLS errors", new BigDecimal(value).doubleValue() > 0.0); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "tls"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "tls"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some TLS errors", new BigDecimal(value).doubleValue() > 0.0); } @@ -178,11 +178,11 @@ private void testNetworkErrors() throws IOException, InterruptedException { // See some network errors on JWT's - String value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "connect"); + String value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "connect"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some network errors", new BigDecimal(value).doubleValue() > 0.0); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "connect"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "connect"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some network errors", new BigDecimal(value).doubleValue() > 0.0); } @@ -193,11 +193,11 @@ private void postInitCheck() throws IOException { // mockoauth has JWKS endpoint configured to return 404 // error counter for 404 for JWT should not be zero as at least one JWKS request should fail // during JWT listener's JWTSignatureValidator initialisation - String value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "404"); + String value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "error", "error_type", "http", "status", "404"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some 404 errors", new BigDecimal(value).doubleValue() > 0.0); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "http", "status", "404"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "error", "error_type", "http", "status", "404"); Assert.assertNotNull("Metric missing", value); Assert.assertTrue("There should be some 404 errors", new BigDecimal(value).doubleValue() > 0.0); } @@ -207,33 +207,33 @@ private void zeroCheck() throws IOException { // assumption check // JWT listener config (on port 9404 in docker-compose.yml) has no token endpoint so the next metric should not exist - String value = metrics.getValue("strimzi_oauth_validation_requests_count", "context", "JWT"); + String value = metrics.getValueStartsWith("strimzi_oauth_validation_requests_count", "context", "JWT"); Assert.assertNull(value); // initial checks - all success counters should be null - value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWT", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWT", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "INTROSPECT", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "INTROSPECT", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECT", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "INTROSPECT", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_count", "context", "JWTPLAIN", "outcome", "success"); Assert.assertNull(value); - value = metrics.getValue("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "outcome", "success"); + value = metrics.getValueStartsWith("strimzi_oauth_http_requests_totaltimems", "context", "JWTPLAIN", "outcome", "success"); Assert.assertNull(value); } diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 9d770c5f..04bf81c4 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -50,7 +50,7 @@ 1.0.0-SNAPSHOT .. - quay.io/strimzi/kafka:0.39.0-kafka-3.6.1 + quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 @@ -462,6 +462,35 @@ quay.io/strimzi/kafka:0.39.0-kafka-3.6.1 + + kafka-3_6_2 + + + quay.io/strimzi/kafka:0.42.0-kafka-3.6.2 + + + + kafka-3_7_1 + + + quay.io/strimzi/kafka:0.44.0-kafka-3.7.1 + + + + + kafka-3_8_1 + + + quay.io/strimzi/kafka:0.45.0-kafka-3.8.1 + + + + kafka-3_9_0 + + + quay.io/strimzi/kafka:0.45.0-kafka-3.9.0 + +