Pub/Sub messaging instrumentation
meltsufin opened this issue · 5 comments
The original request is here: spring-attic/spring-cloud-gcp#2073, but I think it belongs better in this repo. As I started working on it, I realized that we can implement the instrumentation without any dependency on Spring Cloud GCP, which would enable it to be useful in wider contexts.
Feature:
Implement Brave instrumentation for Pub/Sub client library, similar to Kafka or Spring Rabbit.
Rational
Although this can be partially achieved with Spring Integration, it doesn't work when using the PubSubTemplate
directly. If we instrument the Publisher
, Subscriber
, and SubscriberStub.pullCallable()
, we can provide general Brave messaging instrumentation for Pub/Sub client library, which would also allow us to provide instrumentation for PubSubTemplate
as well.
Example Scenario
This would enable tracing for applications that use Pub/Sub to exchange messages across microservices.
Prior Art
- Kafka instrumentation
- Spring Rabbit instrumentation
- AWS SQS instrumentation
- Interestingly this implementation only supports the producer side. I'm not sure why.
@adriancole I'm happy to work on contributing this. Do you have any thoughts on the approach and whether it belongs in this repo?
seems good for here, Mik. When using anything for a model, Kafka (or JMS) are the better ones to look at as they've had more eyes and experience. spring-rabbit is a bit weird as it relies on JMS. The AWS instrumentation are a mixed bag.
Any updates on this @meltsufin or anyone else? Not sure I understand if PubSub tracing is fully supported or not now with Cloud Trace and Spring Stream binders..
This was done in Spring Cloud GCP > 2.0.6, see docs here.
We are no longer planning to port functionality into this repo, so I'll close the issue.
Oh, and Spring Integration / Spring Cloud Stream tracing was supported even prior to this.
OK, thanks for clarifying!