Skip to content

ltsv-tailer is the exporter for Prometheus that reads LTSV files like `tail -F` and exports metrics by given metrics configuration.

License

Notifications You must be signed in to change notification settings

hirose31/ltsv-tailer

Repository files navigation

GitHub test Go Report Card Go Doc

ltsv-tailer

ltsv-tailer is the exporter for Prometheus that reads LTSV files like tail -F and exports metrics by given metrics configuration.

How to run the example

./example/logger -o tailme -i 1 &

./ltsv-tailer -metrics example/metrics.yml -file tailme -logtostderr &

curl http://127.0.0.1:9588/metrics

Metrics Configuration

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

About

ltsv-tailer is the exporter for Prometheus that reads LTSV files like `tail -F` and exports metrics by given metrics configuration.

Resources

License

Stars

Watchers

Forks

Packages

No packages published