Open digitalsadhu opened 6 years ago
Hi Richard. I guess so. The example is a bit abstract. Tbh we should sit down with the Prometheus folks and see what they think of metric naming conventions and whether they think it jives with their approach. If you want I suppose you could make a mock-up / prototype that's a bit more concrete
Hi again @Dieterbe. Thanks for the response. I may sit down and sketch some code a little.
In any case the problem I'm trying to solve is. "How can you plug in your own metrics system into an app/library"? We do this already with logging. So long as the logger supports the same interface then we don't care which logger a consumer provides.
Something like:
// we are writing some library/app `MyThing`
new MyThing({
logger: yourOwnLogger, // consumer provides logger, this works already
metrics: yourOwnMetrics, // <-- cool if we could also do something like this
})
Inside Library
we make use of logger by calling logger.info
, logger.debug
, logger.error
etc.
So it would be nice if we could allow the consumer to bring their own metrics function/implementation and would could make use of it internally as appropriate.
I'll see if I can find some time to sketch out something a bit more specific at some point.
Thanks!
I think it makes sense
I'm toying with the idea of supporting passing in metrics "adapters" to a library and then internal to the library just calling said adapters with a standardized metrics format.
Example
Do you think metrics2.0 would be a good choice for the wire format? It should have most things needed in order to write adapters for the various metrics systems like prometheus etc. right?