tonic icon indicating copy to clipboard operation
tonic copied to clipboard

How to combine two service

Open caibirdme opened this issue 2 years ago • 2 comments

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

caibirdme avatar Jan 24 '24 12:01 caibirdme

You can call add_service() as often as you like.

matze avatar Jan 25 '24 15:01 matze

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>

caibirdme avatar Jan 26 '24 01:01 caibirdme