googleapis / google-http-java-client

Google HTTP Client Library for Java
Apache License 2.0
1.39k stars 448 forks source link

Micrometer Observation Support #1868

Open marcingrzejszczak opened 1 year ago

marcingrzejszczak commented 1 year ago

I'm a co-maintainer of Spring Cloud Sleuth and Micrometer projects (together with @shakuzen and @jonatan-ivanov).

Micrometer Observation is part of the Micrometer 1.10 release and Micrometer Tracing is a new project. The idea of Micrometer Observation is that you instrument code once but you get multiple benefits out of it - e.g. you can get tracing, metrics, logging or whatever you see fit).

Since this project supports OpenCensus that is deprecated I was curious if there's interest in adding Micrometer Observation support so that except for metrics, spans could be created and tracing context propagation could happen too. Via Micrometer Tracing one can use OpenTelemetry or OpenZipkin Brave Tracer, but with the handler mechanism the possibilities are endless :)

If there's such interest we could provide a PR to add support for that.

marcingrzejszczak commented 1 year ago

Hey I've created a draft PR https://github.com/googleapis/google-http-java-client/pull/1879 where we could discuss how this could theoretically look like.

blakeli0 commented 11 months ago

Hi @marcingrzejszczak, thanks for opening the issue! Migrating from OpenCensus to OpenTelemetry is in our long term vision but not in the near future, and adding Micrometer is not on our roadmap at this moment either. If you are interested, you can take a look at the possibility of adding Micrometer support to gax-java, which is the runtime dependency for all the Google Cloud Client libraries. We don't have plans to add Micrometer to gax-java at this moment either, but it is being more actively maintained and the possibility of having Micrometer support is higher. In addition, I have a PoC code for adding OpenTelemetry support to gax-java, which may give you some ideas.