Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Breaking change to tag customizer interfaces in v5.4.5 #1434

Closed
pmoncznik opened this issue Feb 21, 2023 · 2 comments
Closed

bug: Breaking change to tag customizer interfaces in v5.4.5 #1434

pmoncznik opened this issue Feb 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@pmoncznik
Copy link

There was a change in #1354 which adds an additional DgsGraphQLMetricsInstrumentation.MetricsInstrumentationState parameter to the DgsExecutionTagCustomizer, DgsFieldFetchTagCustomizer, and DgsGraphQLMetricsTagsProvider interfaces. These changes are breaking for any consumers that have implementations of these interfaces.

Expected behavior

Minor releases do not include breaking changes to APIs. The following customizer should work with v5.4.5:

@Component
class DgsMetricsCustomizer implements DgsExecutionTagCustomizer, DgsFieldFetchTagCustomizer {
    @Override
    public Iterable<Tag> getExecutionTags(final InstrumentationExecutionParameters parameters,
                                          final ExecutionResult executionResult,
                                          final Throwable throwable) {
        return Tags.empty();
    }

    @Override
    public Iterable<Tag> getFieldFetchTags(final InstrumentationFieldFetchParameters parameters,
                                           final Throwable throwable) {
        return Tags.empty();
    }
}

Actual behavior

An AbstractMethodError is thrown from DgsGraphQLCollatedMetricsTagsProvider:

Caused by: java.lang.AbstractMethodError: com.indeed.boot.graphql.tracing.DgsMetricsCustomizer.getFieldFetchTags(Lcom/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation$MetricsInstrumentationState;Lgraphql/execution/instrumentation/parameters/InstrumentationFieldFetchParameters;Ljava/lang/Throwable;)Ljava/lang/Iterable;
	at com.netflix.graphql.dgs.metrics.micrometer.DgsGraphQLCollatedMetricsTagsProvider.getFieldFetchTags(DgsGraphQLCollatedMetricsTagsProvider.kt:54)
	at com.netflix.graphql.dgs.metrics.micrometer.DgsGraphQLMetricsInstrumentation.recordDataFetcherMetrics(DgsGraphQLMetricsInstrumentation.kt:208)
	at com.netflix.graphql.dgs.metrics.micrometer.DgsGraphQLMetricsInstrumentation.instrumentDataFetcher$lambda$2(DgsGraphQLMetricsInstrumentation.kt:157)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:282)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:211)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:59)
	at graphql.execution.Execution.executeOperation(Execution.java:159)
	at graphql.execution.Execution.execute(Execution.java:105)
	at graphql.GraphQL.execute(GraphQL.java:645)
	at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:564)
	at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:995)
	at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2137)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:559)
	at graphql.GraphQL.executeAsync(GraphQL.java:527)
	at com.netflix.graphql.dgs.internal.BaseDgsQueryExecutor.baseExecute(BaseDgsQueryExecutor.kt:127)
	at com.netflix.graphql.dgs.internal.DefaultDgsQueryExecutor.execute(DefaultDgsQueryExecutor.kt:79)
	... 74 more

Steps to reproduce

Compile the example DgsMetricsCustomizer class above against v5.4.4 and package into a library. Attempt to use it in a service running v5.4.5.

@pmoncznik pmoncznik added the bug Something isn't working label Feb 21, 2023
@srinivasankavitha
Copy link
Contributor

Thanks for the detailed description. Apologies for the breakage. We realized this was a breaking change inadvertently after the minor release. Please update your code by adding the additional parameter.

@srinivasankavitha
Copy link
Contributor

Closing this issue for now. Please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants