ltsv-tailer

module
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0

README

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

Directories

Path Synopsis
cmd
pkg
metrics
Package metrics provides Config struct
Package metrics provides Config struct
targetfile
Package targetfile ...
Package targetfile ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL