Skip to content

Metric plugins - mackerel-plugin-accesslog

mackerel-plugin-accesslog aggregates the web server access logs every minute and allows you to monitor metrics such as the number of accesses per status code.

Supported log formats

  • Logs in common Apache formats, such as Apache and Nginx (Common / Combined)
  • LTSV

Monitorable metrics

Access Num

Counts of accesses per status code.

Metric Display NameMetric NameDiffStackedDescription
Total Countcustom.accesslog.access_num.total_countTotal number of accesses
HTTP 2xx Countcustom.accesslog.access_num.2xx_countNumber of status code 2xx
HTTP 3xx Countcustom.accesslog.access_num.3xx_countNumber of status code 3xx
HTTP 4xx Countcustom.accesslog.access_num.4xx_countNumber of status code 4xx
HTTP 5xx Countcustom.accesslog.access_num.5xx_countNumber of status code 5xx

Access Rates

Percentage of each status code.

Metric Display NameMetric NameDiffStackedDescription
HTTP 2xx Percentagecustom.accesslog.access_rate.2xx_percentagePercentage of 2xx
HTTP 3xx Percentagecustom.accesslog.access_rate.3xx_percentagePercentage of 3xx
HTTP 4xx Percentagecustom.accesslog.access_rate.4xx_percentagePercentage of 4xx
HTTP 5xx Percentagecustom.accesslog.access_rate.5xx_percentagePercentage of 5xx

Latency (Available only LTSV)

Latency.

Metric Display NameMetric NameDiffStackedDescription
Averagecustom.accesslog.latency.averageAverage
90 Percentilecustom.accesslog.latency.90_percentile90 percentile
95 Percentilecustom.accesslog.latency.95_percentile95 percentile
99 Percentilecustom.accesslog.latency.99_percentile99 percentile

Configurable options

OptionDescriptionDefault
--formatSpecify the format of the access log at apache or ltsv.auto
--metric-key-prefixSpecify metric name prefix.accesslog
--posfileDirectory path where posfile are saved.See beside the column.
--no-posfileAggregate for all logs without using posfile.false
  • About posfile
    • The aggregate results of the latest log will be saved. The next time it is run, the difference will be posted as a metric
    • By default, it is stored in /var/tmp/mackerel-agent/mackerel-plugin-accesslog.d

Example configuration

To monitor the access log /path/to/access.log, do the following.

toml
[plugin.metrics.accesslog]
command = ["mackerel-plugin-accesslog", "/path/to/access.log"]

Repository

[https://github.com/mackerelio/mackerel-agent-plugins/tree/master/mackerel-plugin-accesslog]