vlamug / ratibor

Ratibor is a service for making metrics from data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add possibility to have optional values in metric label.

vlamug opened this issue · comments

- name: handler_requests_total
  type: counterVec
  help: "Total requests by handler"
  value: 1
  labels:
  - name: "status"
    values:
      - value: "200"
        expr: {{if eq .status `200`}}1{{end}}
  - name: "handler"
    values:
    - value: "{{ extractRegExp `\\/blog\\/[a-zA-Z-_\\/]+` .request }}"
      expr: "{{if contains .request `blog`}}1{{end}}"
    - value: "home"
      expr: "{{if eq .request `/`}}1{{end}}"