graphql-spring-boot icon indicating copy to clipboard operation
graphql-spring-boot copied to clipboard

Cannot disable tracing response with graphql-spring-boot-starter version 15

Open steam0 opened this issue 7 months ago • 4 comments

Describe the bug

I am in the progress of upgrading to version 15 of the following dependency

<dependency>
    <groupId>com.graphql-java-kickstart</groupId>
    <artifactId>graphql-spring-boot-starter</artifactId>
    <version>${graphql-java-kickstart.version}</version>
</dependency>

When I do that I get an extensions object in my response like the one below:

{
    "extensions": {
        "tracing": {
            "version": 1,
            "startTime": "2023-11-13T11:31:29.328819Z",
            "endTime": "2023-11-13T11:31:29.435707Z",
            "duration": 107035750,
            "parsing": {
                "startOffset": 2249667,
                "duration": 2161084
            },
            "validation": {
                "startOffset": 7496208,
                "duration": 5197250
            },
            "execution": {
                "resolvers": [
                   (...)
                ] 
            }
        }
    }

I would like to disable this part of the response as it is simply too much data for my clients to load every time. I am reading in the documentation here: https://github.com/graphql-java-kickstart/graphql-spring-boot#tracing-and-metrics

Apollo style tracing along with two levels of metrics based on them are currently configurable. Full tracing is based on the GraphQL java implementation, and can be enabled in the application.yml or application.properties file: the default value is false, with "metrics-only" being available. Metrics-only does not add the tracing extension to the response.

However even if I set the value to metrics-only the extensions object is included.

graphql:
  servlet:
    mapping: /api/graphql
    enabled: true
    exception-handlers-enabled: true
    actuator-metrics: true
    tracing-enabled: metrics-only

The only way to disable the "extensions" part of the reponse object is by disabling graphql.servlet.actuator-metrics: false all together which is not desirable as we wish to produce actuator metrics.

Expected behavior

When setting the config paramter graphql.servlet.tracing-enabled: metrics-only the response from the servlet should not include the "extensions" object.

If applicable, add screenshots to help explain your problem. MacOS Sonoma Java17 Intellij Spring Boot 3.1.4

steam0 avatar Nov 13 '23 11:11 steam0