We have many microservices in the system. I want to build a Java library to propagate auth tokens to each service request.
I can intercept HHTP headers and write a custom interceptor for each client like RestTemplate, WebClient to inject headers. The problem here is it I have to write for each request library and then ask service owners to inject this interceptor.
I got to know about open telemetry (Java auto instrumentation). Is there a way to add custom headers either in source code or implement some class and build a new agent which can be integrated into all microservices running in Java?