diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/actuate/metrics/GraphQlTags.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/actuate/metrics/GraphQlTags.java index c88007fe..5849e81f 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/actuate/metrics/GraphQlTags.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/actuate/metrics/GraphQlTags.java @@ -27,6 +27,8 @@ import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchPar import graphql.schema.GraphQLObjectType; import io.micrometer.core.instrument.Tag; +import org.springframework.util.CollectionUtils; + /** * Factory methods for Tags associated with a GraphQL requests. * @@ -60,7 +62,7 @@ public final class GraphQlTags { public static Tag errorPath(GraphQLError error) { StringBuilder builder = new StringBuilder(); List pathSegments = error.getPath(); - if (!pathSegments.isEmpty()) { + if (!CollectionUtils.isEmpty(pathSegments)) { builder.append('$'); for (Object segment : pathSegments) { try {