If you know where in your code or in the library code is the query used, you can configure request attributes capturing the method arguments. You can also use OpenTelemetry instrumentation for GraphQL and have Dynatrace capture the span attributes provided by the OpenTelemetry instrumentation, which is probably the easiest way.
Be sure to check the Observability clinic recording on GraphQL and Dynatrace and how to leverage OpenTelemetry to provide you with more insights into your GraphQL applications.
@nhutdangqn there is a section about other languages at https://www.youtube.com/watch?v=_-ZPhwOWzmw&t=1542s , basically mentioning you should use https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/graph... in your project. The docs seys a standalone instrumentation is supported, so you don't need OpenTelemetry Java Agent for it.
Also, be sure to have the OneAgent feature flag for Opentelemetry turned on (OpenTelemetry (Java) ), so Dynatrace can pick up the OpenTelemetry spans.
Yes , that's correct. Only NodeJS is supported out of box as it is mentioned in the technology support page and also on the hub page. For traces from other languages you need to use either opentelemetry or create a custom instrumentation with the otel being a recommended approach.