grok_exporter icon indicating copy to clipboard operation
grok_exporter copied to clipboard

Memory (and Handle) leak on Windows Server 2016

Open safebear opened this issue 3 years ago • 10 comments

I'm running grok exporter on Windows Server 2016 and seeing a memory leak:

image

It's leaking 75MB a day, which is about 1 GB every two weeks.

Here's my config (sanitized):

---
global:
  config_version: 3
input:
  type: file
  paths:
  - ../../../../afolder/*.log
  - ../../../../anotherfolder/*.log
  - '../../../../Program Files/PostgreSQL/11/data/log/postgresql-*.log'
  readall: false
  fail_on_missing_logfile: false
  poll_interval: 10s
grok_patterns:
- removedToSanitizeFile
metrics:
- type: counter
  name: removedToSanitizeFile
  help: removedToSanitizeFile
  match: removedToSanitizeFile
  paths:
  - ../../../../removedToSanitizeFile
  labels:
    error_message: '{{.message}}'
    logfile: '{{base .logfile}}'
- type: counter
  name: removedToSanitizeFile
  help: removedToSanitizeFile
  match: removedToSanitizeFile
  path: ../../../../removedToSanitizeFile
  labels:
    error_message: '{{.message}}'
    logfile: '{{base .logfile}}'
- type: counter
  name: postgres_errors
  help: Number of postgres errors per error type.
  match: '%{POSTGRES_DATE} %{POSTGRES_CODE}:
  %{POSTGRES_USER},%{POSTGRES_DB},%{POSTGRES_APP},%{POSTGRES_CLIENT}
  %{POSTGRES_ERROR_MESSAGE:message}$'
  paths:
  - '../../../../Program Files/PostgreSQL/11/data/log/postgresql-*.log'
  labels:
    error_message: '{{.message}}'
    logfile: '{{base .logfile}}'
server:
  protocol: http
  port: 3903

Please can you let me know if there's anything I can do to investigate this memory leak further and pinpoint the cause of it? Would pprof help...? https://github.com/google/pprof

safebear avatar Dec 16 '20 17:12 safebear