Skip to content

Commit

Permalink
Sample YAML config for log parsing + README update on same topic
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoppel committed Jan 16, 2020
1 parent 6bcb765 commit f0d9e4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -375,7 +375,9 @@ formats user needs to specify a regex that parses out as a named group following
See [here](https://github.com/cybertec-postgresql/pgwatch2/blob/master/pgwatch2/logparse.go#L27) for an example regex.

NB! Note that only the event counts are stored, by severity, for the monitored DB and for the whole instance - no error
texts or username infos! The metric name to enable log parsing is "server_log_event_counts".
texts or username infos! The metric name to enable log parsing is "server_log_event_counts". Also note that for auto-detection
of log destination / setting to work the monitoring user needs superuser / pg_monitor rights - if this is not possible
then log settings need to be specified manually under "Host config" as seen for example [here](https://github.com/cybertec-postgresql/pgwatch2/blob/master/pgwatch2/config/instances.yaml).

# Adding metrics

Expand Down
2 changes: 2 additions & 0 deletions pgwatch2/config/instances.yaml
Expand Up @@ -40,6 +40,8 @@
ca_file:
cert_file:
cert_key:
logs_glob_path: "/tmp/*.csv"
logs_match_regex: ^(?P<log_time>.*?),"?(?P<user_name>.*?)"?,"?(?P<database_name>.*?)"?,(?P<process_id>\d+),"?(?P<connection_from>.*?)"?,(?P<session_id>.*?),(?P<session_line_num>\d+),"?(?P<command_tag>.*?)"?,(?P<session_start_time>.*?),(?P<virtual_transaction_id>.*?),(?P<transaction_id>.*?),(?P<error_severity>\w+),
stmt_timeout: 5
preset_metrics:
custom_metrics:
Expand Down

0 comments on commit f0d9e4c

Please sign in to comment.