Fine-tuning monitoring data collection Innovation Release

The template provided in Configuring the agent enables all monitoring features. You can fine-tune the features that are enabled.

Time-series metrics (the Monitoring tab)

The general.metrics.push section of the configuration file controls pushing time series metrics back to the Prometheus instance in Hybrid Manager (HM). These metrics populate the Monitoring tab. To disable this, set general.metrics.push.enabled to false.

Postgres logs (the Logs tab)

Enable log collecting by setting general.metrics.push.include_logs to true. Disable it at the agent level by setting this value to false. In addition, set logs.disabled to false for each entry in provider.onprem.clusters.nodes for which you want to collect Postgres logs.

By default, the agent attempts to discover the location of the log files by calling the Postgres function pg_current_logfile(). If you want to explicitly specify the location of the log files because, for example, you configured your Postgres instance to store logs at a different location, substitute <logs_directory> with the path to the directory where you're storing log files.

For example, to collect logs with the extension .log from filepath /var/log/postgres-lc, you can use the pattern /var/log/postgres-lc/*.log.

clusters:
  - resource_id: selfmanaged_postgres
    ...
    nodes:
      - resource_id: selfmanaged_postgres_node1
        ...
        logs:
          disabled: false
          mode: file
          file:
            paths: <logs_directory>/*log

Diagnostics (Query Diagnostics and Recommendations tabs)

The metrics.stats section under each entry in provider.onprem.clusters.nodes controls collecting more detailed diagnostic data for query analysis and optimization.

You can disable all such data collection by setting metrics.stats.enabled to false. Alternatively, you can enable or disable each element by setting the appropriate enabled parameter:

  • metrics.stats.wait_states controls the collection of query data based on sampling the session state from EDB Wait States.
  • metrics.stats.query_text controls the collection of query statistics from EDB Stat Monitor.

If both of these options are disabled, the Query Diagnostics tab becomes disabled.

  • metrics.stats.recommendations controls collecting index and statistics recommendations from EDB Query Advisor. If disabled, the Recommendations tab doesn't display index and statistics recommendations, but still displays other recommendations.

  • metrics.stats.query_text controls collecting query texts from both EDB Wait States and EDB Stat Monitor. If disabled, no query texts are collected and you see only query ID in Query Diagnostics.