I am using Spring Cloud Sleuth to send spans to zipkin when a Spring Boot application sends a message (to RabbitMQ).
I would like to customize the information sent to zipkin to include some extra tags that are populated from certain headers of the outgoing Message e.g. the myCustomTag
below.
"traceId": "9fc1f35070446800",
"parentId": "033b24f12d5fe4e8",
"id": "fea24862c3e1f374",
"kind": "PRODUCER",
"name": "send",
"timestamp": 1609943208647127,
"duration": 1407,
"localEndpoint": {
"serviceName": "foo-service",
"ipv4": "10.204.71.17"
},
"remoteEndpoint": {
"serviceName": "broker"
},
"tags": {
"channel": "fooEventsChannel",
"myCustomTag": <some value extracted from the "Bar" header of the outgoing message>
}
Is it possible to do this using Sleuth/brave? It feels like a messaging equivalent of registering (e.g.) a bean of type brave.http.HttpRequestParser
but I couldn't see an obvious way forward.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…