Skip to content

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Nov 19, 2025

Resolves #15278
Also switches to AstPrinter.printAstCompact for constructing the query document.

@laurit laurit requested a review from a team as a code owner November 19, 2025 17:07
Comment on lines -48 to +50
attributes.put(GRAPHQL_DOCUMENT, request.getQuery());
if (request.getQuery() != null) {
attributes.put(GRAPHQL_DOCUMENT, request.getQuery());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think put null is a no-op

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In many places we use AttributesExtractorUtil.internalSet that skips null values. I suspect that the marshaling in sdk does not skip nulls, but didn't verify.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we originally did that because it was previously undocumented behavior, but that changed with open-telemetry/opentelemetry-java#7271, probably we could revisit those places now, but not a priority

@laurit laurit marked this pull request as draft November 19, 2025 19:45
@laurit laurit marked this pull request as ready for review November 19, 2025 20:40
@laurit laurit added this to the v2.23.0 milestone Nov 21, 2025
@trask trask merged commit 1951761 into open-telemetry:main Nov 21, 2025
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add flag to turn off graphql.document attribute in graphql-java instrumentation

3 participants