tonic
tonic copied to clipboard
How to combine two service
Opentelemetry Defines three different services:
- common package contains the common messages shared between different services.
- trace package contains the Trace Service protos.
- metrics package contains the Metrics Service protos.
- logs package contains the Logs Service protos.
I want to know if there's a way to combine those services into one service(Maybe write a new service and don't use those three service definitions?), thus server just needs to listen only one tcp port, and client can send different data to the same server
You can call add_service() as often as you like.
Thx. BTW, are there any examples for using transport::Routes? It seems that I can do Routes::new(svc1).add_service(svc2), But Builder::new().add_service(routes) cannot compile, it requires the Error to be Infillable while the Error of Routes is Box<dyn Error>