# Query details of GraphQL

**URL:** <https://community.dynatrace.com/t/query-details-of-graphql/41313>\
**Category:** Open Q&A\
**Tags:** distributed-traces-classic, graphql\
**Created:** [August 23, 2023, 3:08am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313 "2023-08-23T03:08:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhutdangqn](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@nhutdangqn](https://community.dynatrace.com/u/nhutdangqn)\
**Post date:** [August 23, 2023, 3:08am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/1 "2023-08-23T03:08:05Z")

</div>

Hi team,

I’m using Java, Netflix DGS, and WebFlux. I&nbsp;want to see what kind of query being made to /graphql (operation name in /graphql endpoint)

 ![nhutdangqn_0-1692759958415.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/38068dc951139d56aab12ad2ed4e77a147295287.png)

But on my test, it wasn’t shown. Could you guys help me?

Many thanks!

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 23, 2023, 8:39am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/2 "2023-08-23T08:39:16Z")

</div>

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](https://www.youtube.com/watch?v=_-ZPhwOWzmw) recording on GraphQL and Dynatrace and how to leverage OpenTelemetry to provide you with more insights into your GraphQL applications.

---

<div class="post-metadata">

**Author:** ![nhutdangqn](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@nhutdangqn](https://community.dynatrace.com/u/nhutdangqn)\
**Post date:** [August 24, 2023, 9:02am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/3 "2023-08-24T09:02:38Z")

</div>

Hi&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;,

Thank you for your reply.

[Observability clinic](https://www.youtube.com/watch?v=_-ZPhwOWzmw)&nbsp;is talking GraphQL and Node but I’m using GraphQL in Java so It can’t help me now. Could you have any documentation about GraphQL, Java,&nbsp;Netflix DGS, and WebFlux?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 24, 2023, 9:34am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/4 "2023-08-24T09:34:07Z")

</div>

[@nhutdangqn](https://community.dynatrace.com/user/66132)&nbsp;there is a section about other languages at

[![](https://global.discourse-cdn.com/dynatrace/original/3X/1/8/187a200de468e917e95501d9557f85f569be06a4.jpeg "GraphQL & OpenTelemetry: Observe, Diagnose and Optimize") ](https://www.youtube.com/watch?v=_-ZPhwOWzmw&t=1542s)

, basically mentioning you should use&nbsp;[https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/graphql-java-12.0/library](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/graphql-java-12.0/library)&nbsp;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.

---

<div class="post-metadata">

**Author:** ![Maziz](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@Maziz](https://community.dynatrace.com/u/Maziz)\
**Post date:** [August 24, 2023, 9:17pm UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/5 "2023-08-24T21:17:42Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp; and anyone,

does that mean dynatrace doesn’t support graphql tracing besides nodejs out of the box?

We assumed it support graphql in general out of the box&nbsp;[https://www.dynatrace.com/hub/detail/graphql/](https://www.dynatrace.com/hub/detail/graphql/).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 24, 2023, 9:36pm UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/6 "2023-08-24T21:36:07Z")

</div>

Yes , that’s correct. Only NodeJS is supported out of box as it is mentioned in the [technology support page](https://www.dynatrace.com/support/help/setup-and-configuration/technology-support) 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.

---

<div class="post-metadata">

**Author:** ![Klapsa2503](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@Klapsa2503](https://community.dynatrace.com/u/Klapsa2503)\
**Post date:** [September 30, 2024, 9:10am UTC](https://community.dynatrace.com/t/query-details-of-graphql/41313/7 "2024-09-30T09:10:31Z")

</div>

Our team has included operation name in the logs with following steps:

1. define global request attribute

 ![1.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/b/6b40703054195616e92fd314deba0c2cae7ddd4f.png)

2. inject custom attribute with one agent sdk

```java
@Component
@RequiredArgsConstructor
public class DynatraceGraphQlInstrumentation extends SimplePerformantInstrumentation {

    private final OneAgentSDK oneAgentSDK;

    @Override
    public @NotNull ExecutionContext instrumentExecutionContext(
            ExecutionContext executionContext,
            InstrumentationExecutionParameters parameters,
            InstrumentationState state) {
        oneAgentSDK.addCustomRequestAttribute("graphqlOperationName", executionContext.getOperationDefinition().getName());
        return super.instrumentExecutionContext(executionContext, parameters, state);
    }

}

```

3. define&nbsp;global request naming rule with the API. This makes operation name became visible in the request name. Docs&nbsp;[Request naming API — Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/configuration-api/service-api/request-naming-api).

Final result:

 ![2.png](https://global.discourse-cdn.com/dynatrace/original/1X/80c6158347f18b874ead17af925b1065a9de4d0d.png)
