Prometheus php error log exporter, watches php error logs end exports metrics to prometheus.
Based on foomo/phperrorlog_exporter, updated to latest Go version and dependence with a better logging and readme.
Grafana dashboard sample available there.
go get github.com/prometheus/client_golang/prometheus
go get github.com/prometheus/client_golang/prometheus/promhttp
go get github.com/CodeAtCode/phperrorlog_exporter
cd phperrorlog_exporter
go build phperrorlog_exporter.go
$ phperrorlog_exporter test.com:path/to/log prova:/another/path/log
Listening on address:port => :9423
observing test.com stats map[fatal:1 notice:2110 warning:1]
observing prova stats map[fatal:1 notice:1877 warning:1]
- job_name: 'phperrorlog-exporter'
scrape_interval: 30m
scrape_timeout: 30s
metrics_path: /metrics
static_configs:
- targets:
- default
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: "localhost:9423"
- source_labels: [__param_target]
target_label: instance