Mtail
mtail is a tool for extracting metrics from application logs to be exported into a timeseries database or timeseries calculator for alerting and dashboarding.
It fills a monitoring niche by being the glue between applications that do not export their own internal state (other than via logs) and existing monitoring systems, such that system operators do not need to patch those applications to instrument them or writing custom extraction code for every such application.
Mtail quickstart guide
So, you have a logfile that needs to generate metrics, either for plain monitoring or alerting. You can check this CR on Gerrit, where every aspect of "adding a new set of metrics generated from promtail" is covered. If you don't want to reverse engineer that change, please use the following steps:
- Write a basic
.mtailprogram that will allow you to test things locally, please refer to existing examples and mtail documentation for this - Once you're set
- create a new
prometheus::class_configentry in here - create a new
mtail::programentry in the puppet class you're working on, see this example - add your
.mtailhere inmodules/mtail/files/programs/
- create a new
- Then you'll see metrics appear in /explore