How to get current value from Prometheus using Grok Exporter

40 views
Skip to first unread message

Akila Jayasinghe

unread,
Jul 18, 2019, 11:12:21 AM7/18/19
to Prometheus Users
I have a Grok exporter gauge metric which returning API response time in a audit log file. I'm using grafana dashboard to visualize Prometheus values.

image.pngProblem is Prometheus holding last value of metric until a new value come for it. Think if  "XXX" API's response time is 5 second on 08:33 time and when 08:34 time "XXX" API not called again. But Prometheus still holding his last value until getting a new value. My requirement is, only return current values of the API. (Only return called API response time.) 


I need a solution to clear this issue. Please kindly assist.    


Deep saraswat

unread,
May 24, 2020, 10:54:38 AM5/24/20
to Akila Jayasinghe, Prometheus Users
Hi Akila,

I am too stuck with this issue. Did you find the solution to this problem?

Regards
Deependra

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2f3a20f7-9062-47ee-80d3-41b8bde4d648%40googlegroups.com.

Deep saraswat

unread,
May 24, 2020, 12:18:52 PM5/24/20
to Julien Pivotto, Akila Jayasinghe, Prometheus Users
Hi Julien,

Thanks for your prompt response.

PFB my grok exporter config

global:
  config_version: 3
input:
  type: file
  paths:
  - /root/grok_exporter-1.0.0.RC3.linux-amd64/example/ptchecksum.out
  - /root/grok_exporter-1.0.0.RC3.linux-amd64/example/ptchecksum.err
imports:
- type: grok_patterns
  dir: ./patterns
grok_patterns:
- 'CHECKSUMOUT [a-zA-Z ]*'
metrics:
- type: counter
  name: mysql_ptchecksum_checksum_stats
  help: mysql ptchecksum stats.
  match: '%{MONTHDAY:month}\-%{MONTHDAY:date}\T%{TIME:logtime}\s.*%{INT:ERRORS}\s.*%{INT:DIFFS}\s.*%{NUMBER:ROWS}\s.*%{INT:DIFF_ROWS}\s.*%{INT:CHUNKS}\s.*%{INT:SKIPPED}\s.*%{NUMBER:time} %{GREEDYDATA:TABLE}'
  labels:
    diffs: '{{.DIFFS}}'
    table: '{{.TABLE}}'
    date: '{{.date}}'
    errors: '{{.ERRORS}}'
    rows: '{{.ROWS}}'
    diff_rows: '{{.DIFF_ROWS}}'
    chunks: '{{.CHUNKS}}'
    TS: '{{.logtime}}'
    time: '{{.time}}'
- type: gauge
  name: mysql_ptchecksum_checksuming_status
  help: mysql ptchecksum cheksuming status.
  match: '%{GREEDYDATA:checksum_status}\s%{GREEDYDATA:tabel}\:.*%{NUMBER:completion_percentage}\%\s.*%{NUMBER:TimeRemainingHours}\:%{NUMBER:TimeRemainingMinutes}'
  value: '{{.completion_percentage}}'
  labels:
    status: '{{.checksum_status}}'
    tabel: '{{.tabel}}'
- type: gauge
  name: mysql_ptchecksum_waiting_status
  help: mysql ptchecksum waiting status.
  match: 'Replica lag\s.*\is\s.*%{INT:seconds}\s%{GREEDYDATA:data}\son\s%{GREEDYDATA:server}\.\s'
  value: '{{.seconds}}'
  labels:
    server: '{{.server}}'

server:
  protocol: http
  port: 9144

On Sun, May 24, 2020 at 8:59 PM Julien Pivotto <roidel...@prometheus.io> wrote:
Please share your grok exporter configuration

Julien Pivotto

unread,
May 26, 2020, 6:58:29 PM5/26/20
to Deep saraswat, Akila Jayasinghe, Prometheus Users
Please share your grok exporter configuration

Le dim. 24 mai 2020 à 16:54, Deep saraswat <sarasw...@gmail.com> a écrit :
Reply all
Reply to author
Forward
0 new messages