简体   繁体   中英

Prometheus log metric exporter

I used Prometheus in a Java app to monitor the different number of logs in my system.

Once I added <Prometheus name="METRICS"/> to my log4j.xml appenders configuration my Prometheus metrics were populated with the number of info/error/debug messages that were logged in my system.

This was very helpful. I am trying to achieve the same functionality in a golang microservice which uses the default golang log.

Is there any native prometheus support for this kind of functionality or do i need to implement it myself?

Logger doesn't offer any hooks, so there's no way to create such a thing. What you'd want to do is put a wrapper on top of it, or use a different logging system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM