newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
198 stars 143 forks source link

Trace is not connected between spring cloud gateway and backend server #1233

Open freddi2 opened 1 year ago

freddi2 commented 1 year ago

Description

I'm using SCP(spring cloud gateway) with newrelic agent 8.1.0 A request pass through like this. user -> SCP -> A Component Server -> DB

but, I can't find connection between SCP and A Component Server on the newrelic UI(service map menu) and I can't find any newrelic headers in a request(SCP -> A Component Server)

Is there any problem with newrelic and Spring Cloud Gateway?

If I change SCP to Spring MVC server, it works well. user -> MVC Server -> A Component Server -> DB I can find newrelic, traceparent headers over this flow.

Expected Behavior

passing W3C tracing header(ex. traceparent) and any newrelic headers to backend component.

Troubleshooting or NR Diag results

Steps to Reproduce

Your Environment

Additional context

workato-integration[bot] commented 1 year ago

https://issues.newrelic.com/browse/NEWRELIC-8447

kford-newrelic commented 1 year ago

@freddi2 our team discussed this and the behavior you're seeing is likely because we don't have auto instrumentation support out-of-the-box for Spring Cloud Gateway. So this isn't a bug but would be an enhancement. We can't commit at the moment to add this to our roadmap but we will certainly consider it when we plan our next quarter's work.

And if you had the desire/interest in submitting a PR to add this, it would be appreciated!

freddi2 commented 1 year ago

@kford-newrelic thanks for your answer. so, that means I should append a traceparent header using NewRelic.getAgent().traceMetadata?