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 Name | Metric Name | Diff | Stacked | Description |
---|---|---|---|---|
Total Count | custom.accesslog.access_num.total_count | Total number of accesses | ||
HTTP 2xx Count | custom.accesslog.access_num.2xx_count | ✓ | Number of status code 2xx | |
HTTP 3xx Count | custom.accesslog.access_num.3xx_count | ✓ | Number of status code 3xx | |
HTTP 4xx Count | custom.accesslog.access_num.4xx_count | ✓ | Number of status code 4xx | |
HTTP 5xx Count | custom.accesslog.access_num.5xx_count | ✓ | Number of status code 5xx |
Access Rates
Percentage of each status code.
Metric Display Name | Metric Name | Diff | Stacked | Description |
---|---|---|---|---|
HTTP 2xx Percentage | custom.accesslog.access_rate.2xx_percentage | ✓ | Percentage of 2xx | |
HTTP 3xx Percentage | custom.accesslog.access_rate.3xx_percentage | ✓ | Percentage of 3xx | |
HTTP 4xx Percentage | custom.accesslog.access_rate.4xx_percentage | ✓ | Percentage of 4xx | |
HTTP 5xx Percentage | custom.accesslog.access_rate.5xx_percentage | ✓ | Percentage of 5xx |
Latency (Available only LTSV)
Latency.
Metric Display Name | Metric Name | Diff | Stacked | Description |
---|---|---|---|---|
Average | custom.accesslog.latency.average | Average | ||
90 Percentile | custom.accesslog.latency.90_percentile | 90 percentile | ||
95 Percentile | custom.accesslog.latency.95_percentile | 95 percentile | ||
99 Percentile | custom.accesslog.latency.99_percentile | 99 percentile |
Configurable options
Option | Description | Default |
---|---|---|
--format | Specify the format of the access log at apache or ltsv. | auto |
--metric-key-prefix | Specify metric name prefix. | accesslog |
--posfile | Directory path where posfile are saved. | See beside the column. |
--no-posfile | Aggregate 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.
[plugin.metrics.accesslog] command = ["mackerel-plugin-accesslog", "/path/to/access.log"]
Repository
https://github.com/mackerelio/mackerel-agent-plugins/tree/master/mackerel-plugin-accesslog