Entity sequence in distributed trace service map

Hi all,

I have the following “issue”…

From Postman I call
“Spring boot service 1 with NR agent”
Then this service calls
“Spring boot service 2 with NR agent”
Then this calls
“Spring boot service 3 with NR agent”
which in turn sends a message to an MQTT topic and then
“MQTT Go Program picks up the message, acceptsDistributedTraceHeaders and publishes a message”

The code part which listens on the MQTT topic and then publishes looks like:

app, err := makeApplication("telemetry")

txn := app.StartTransaction("publishTelemetryMessage")
txn.AcceptDistributedTraceHeaders(newrelic.TransportOther, h)
txn.AddAttribute("vin", "WVWZZZX1ZLP023325")
txn.Application().RecordCustomMetric("temperature", 32.678)

m := IoTDeviceData{ DeviceId: "WVWZZZX1ZLP023325"}//, Mileage: Mileage{MileageCurrentTrip: mileageCurrentTrip, TotalMileage: mileage}}
segment := txn.StartSegment("getBatteryStatus")
m.BatteryStatus = getBatteryStatus()
segment.End()

segment2 := txn.StartSegment("getCurrentMileage")
m.Mileage = getCurrentMileage()
segment2.End()

segment3 := txn.StartSegment("getCurrentLocation")
m = getCurrentLocation(m)
segment3.End()

b, err := json.Marshal(m)
fmt.Println(err)
fmt.Println(string(b))

publishTelemetryMessage(*topic_moon_telemetry, string(b), *txn)

txn.End()
app.Shutdown(10 * time.Second)

The issue is:

On the service map graph, we clearly see service 1 calling service 2, then service 2 calling service 3, but then it shows service 2 also calling the Go program… which is not correct… it is actually service 3 calling the Go program… it must have something to do with the traceparent header… I can see that in between the services, the portion after the second “hyphen” of traceparent changes… but it would not for the Go lang program… is this the issue? Do we have to manually alter the headers somehow to get a correct sequence in the service map?

Thank you!
Thomas

@thomas.hoefkens, this is interesting. Is this issue resolved? If yes, would be helpful if you share the resolution in the post for our community users in case they face a similar problem. If not, I would also be interested in looking at the code of the method from the Spring boot 3 service sending out a message to an MQTT topic. Did you check the java agent logs from both services 2 & 3 for any links to the other go service? This would probably help you understand what’s happening in the background. Steps to generate the finest level logs can be seen here: Generate debug logs for troubleshooting (Java) | New Relic Documentation

Cheers

This topic was automatically closed after 365 days. New replies are no longer allowed.