mtail is a log-based metrics extraction tool that parses application logs in real time to generate monitoring data for timeseries databases.
The tool solves the problem of extracting structured metrics from unstructured log output without modifying application code. mtail works by reading logs as they are written, applying pattern-matching rules defined in a custom language, and emitting metrics that can be collected by monitoring systems. It uses a compiler and virtual machine approach to execute these extraction programs efficiently, allowing operators to define what data should be extracted through declarative mtail program files rather than requiring application changes.
mtail suits environments where applications already produce detailed logs but lack native instrumentation, or where adding instrumentation would require code changes. It works well for legacy applications, third-party software, or situations where log parsing is preferable to modifying application behavior. The tool integrates with Prometheus and other timeseries databases through standard collection mechanisms, making it useful in observability pipelines that already depend on those systems.
Development on the project shows consistent activity across multiple areas. The codebase receives regular updates to the core extraction and compilation logic. Work continues on the mtail program language itself, including its syntax and semantics. The test suite is actively maintained with new test cases being added. Documentation receives ongoing attention with updates to guides and examples. The project maintains a pattern of addressing issues and incorporating feedback from users running mtail in production environments.