Open
Description
Openethereum needs to add prometheus metrics https://github.com/openethereum/openethereum/issues/11725, and I am looking for the best option to do it.
I realized about the health API, but we cannot use it for now:
- There is no way to define more that one endpoint for it
- We cannot use or modify the current
/api/health
path because it could break current user's monitorization tools. - We need to output text instead json (string without
"
and no carriage return escapes)
I would like to purpose extending the functionality of health_api in the following way, without introducing any breaking change in the current api:
- add a method
.raw_api(path,rpc_method)
in the builder, which allows to dump the result as Vec without JSONify. - allow multiple raw api handlers
I am aware that this breaks a little the spirit of a json-based library but opens the possibility to handle this case, but also in a very flexible way that could help other future use cases.
If something like this is ok, I can write the feature and do a PR for it.