apollographql / supergraph-demo-fed2

🍿 Supergraph demo for Federation 2 and Apollo Router
Other
166 stars 61 forks source link

New Kotlin inventory subgraph needs open telemetry tracing support #67

Open prasek opened 2 years ago

prasek commented 2 years ago

The previous NodeJS inventory subgraph supported otel tracing, so we need to add the same for the Kotlin port.

Demo instructions should work as before: https://github.com/apollographql/supergraph-demo-fed2#tracing-with-open-telemetry

Something similar to previous Node inventory service would be ideal so it just slots into the existing https://github.com/apollographql/supergraph-demo-fed2/blob/main/docker-compose.otel-collector.yml

martinbonnin commented 2 years ago

Thanks for noticing this! Looks like we're going to need https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/4270

I'm pretty new to all of this so it may take some time. Feel free to revert the inventory service to NodeJS until we figure this out.

prasek commented 2 years ago

/cc @hwillson @lennyburdette

prasek commented 1 year ago

@dariuszkuc @korinne is it relatively easy to add the java otel support here to bring this back to parity? do you have suggestions on what libs to use or examples we should follow?

dariuszkuc commented 1 year ago

Since we are using Spring we probably should use their suggested library -> micrometer tracing (formerly known as Spring Cloud Sleuth). AFAIK it should "just work" - i.e. generate trace per HTTP request.

Unsure what extra information would open-telemetry lib bring (or even whether it is necessary) but we could probably try adding that as well. Looks like it parses the request to get some basic info - depending on how they implemented it I'm guessing it might be adding some processing overhead (e.g. naive solution would be to parse the request body in the webfilter).