ltsv-tailer
is the exporter for Prometheus that reads LTSV files like tail -F
and exports metrics by given metrics configuration.
./example/logger -o tailme -i 1 &
./ltsv-tailer -metrics example/metrics.yml -file tailme -logtostderr &
curl http://127.0.0.1:9588/metrics
Example metrics configuration:
transform:
### "GET" -> "get"
#tolower:
# - method
### strip query string from path
#strip_query_string:
# - path
### transform resptime in microsec into second
#tosec:
# - resptime: microsec
metrics:
- name: ltsv_http_request_count_total
kind: counter
value_key: COUNTER
help: http request count total
labels:
- vhost
- method
- code
- name: ltsv_http_response_bytes_total
kind: counter
value_key: size
help: http response bytes total
labels:
- vhost
- method
- code
- name: ltsv_http_response_seconds
kind: histogram
value_key: resptime
help: http response seconds
buckets:
- 0.25
- 0.5
- 1.0
- 2.5
- 5.0
- 10.0
labels:
- vhost
- method
- code