Currently, we have a race condition when the specified ports for the API and metrics endpoints are the same. In that case, one of the two takes the port first and the other one fails to start.
What I propose is merging both start_metrics_server and start_api_server functions into a single one receiving an RpcConfig struct. Inside that function we can choose to merge both API and metrics routers into a single endpoint or not, depending on the ports chosen.
Currently, we have a race condition when the specified ports for the API and metrics endpoints are the same. In that case, one of the two takes the port first and the other one fails to start.
What I propose is merging both
start_metrics_serverandstart_api_serverfunctions into a single one receiving anRpcConfigstruct. Inside that function we can choose to merge both API and metrics routers into a single endpoint or not, depending on the ports chosen.