Raj Kamal Singh f24135f5b0
Feat: QS: postgres integration: instructions for collecting and parsing logs (#4738)
* chore: offer metrics config instructions for signoz cloud only

* chore: some more cleanups

* chore: get log collection instructions started

* feat: flesh out log collection otel config for postgres

* chore: some cleanup

* chore: some more cleanup

* chore: some more cleanup
2024-03-23 11:39:28 +05:30

1.7 KiB

Before You Begin

To configure metrics and logs collection for a Postgres server, you need the following.

Ensure Postgres server is prepared for monitoring

  • Ensure that the Postgres server is running a supported version
    Postgres versions 9.6+ are supported.
    You can use the following SQL statement to determine server version

    SELECT version();
    
  • If collecting metrics, ensure that there is a Postgres user with required permissions
    To create a monitoring user for Postgres versions 10+, run:

    create user monitoring with password '<PASSWORD>';
    grant pg_monitor to monitoring;
    grant SELECT ON pg_stat_database to monitoring;
    

    To create a monitoring user for Postgres versions >= 9.6 and <10, run:

    create user monitoring with password '<PASSWORD>';
    grant SELECT ON pg_stat_database to monitoring;
    

Ensure OTEL Collector is running with access to the Postgres server

  • Ensure that an OTEL collector is running in your deployment environment
    If needed, please install an OTEL Collector
    If already installed, ensure that the collector version is v0.88.0 or newer.

    Also ensure that you can provide config files to the collector and that you can set environment variables and command line flags used for running it.

  • Ensure that the OTEL collector can access the Postgres server
    In order to collect metrics, the collector must be able to access the Postgres server as a client using the monitoring user.

    In order to collect logs, the collector must be able to read the Postgres server log file.