0

We have below app archtecture setup.

ReactJS UI -> NodeJs layer ->Azure Service Bus -> Spring boot app.

When we make a call from UI, the request goes through the above flow and the response gets back to the UI. We have web, Java and node JS new relic agents setup. Trace ID's are being generated and passed along to track the distributed tracking flow. We want to add a custom attribute(username) to the each of the trace and span. By that way we can get the entire activity performed by the user on a given day. I was able to see new relic custom attribute feature can be used for this purpose.

My questions here is

  1. When I set newrelic.setCustomAttribute('userID', user_ID); from the UI , will it be passed automatically to all the spans that happened for each transaction ?
  2. If i want to use and read the custom attribute in spring boot app, how do i read it in java app ?
Sathees Rajagopal
  • 113
  • 1
  • 2
  • 11

1 Answers1

0
  1. No, newrelic.setCustomAttribute() decorates just the span representing the method it is called in but since that span is part of a trace, you can search for that trace on the New Relic Trace UI using that custom attribute.

  2. I'm not sure I understand the question. If you're asking if you can have an upstream agent, say in your NodeJS layer add the custom attribute and then have a downstream agent in spring boot layer read the custom attribute the answer is no, you can't. Your custom attribute will not be part of the trace context passed down from upstream agent to downstream agent