PostgreSQL Vector source

Get more insights into the operation of your PostgreSQL databases with our Vector PostgreSQL integration.

Vector has a PostgreSQL source that collects metrics from PostgreSQL databases. When these PostgreSQL metrics are sent to AppSignal, the metrics from this Vector source will be shown in our PostgreSQL automatic dashboard. This dashboard will tell you more about:

  • how many records were selected, inserted, updated and deleted.
  • how many transactions were committed and rolled back.
  • how many deadlocks were detected.
  • how many temporary files were written during the operation of the database.

Configuration

If you've not set up Vector yet, please see the Vector configuration section for more information, such as which Push API key to use.

To send Vector PostgreSQL data to AppSignal you need to configure the PostgreSQL source and AppSignal sink in your Vector configuration. We'll be using the TOML configuration file as an example.

  1. Add a new source of the postgresql_metrics source type to your configuration file. The name of the source is the part following the dot in sources.postgresql, not the postgresql_metrics type.
    TOML
    [sources.postgresql] type = "postgresql_metrics"
  2. Configure the source's endpoints option with the PostgreSQL connection string for your database. Replace the variables ($VARIABLE_NAME) with the values for your database, or pass them as environment variables.
    TOML
    [sources.postgresql] type = "postgresql_metrics" endpoints = ["postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB"]
  3. Update inputs in the appsignal sink to include the name of the postgresql_metrics source:
    TOML
    [sinks.appsignal] inputs = ["postgresql"] # Other config

Shown below is an example vector.toml configuration file. Your Vector configuration method may be different.

TOML
[sources.postgresql] type = "postgresql_metrics" endpoints = ["postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB"] [sinks.appsignal] type = "appsignal" inputs = ["postgresql"] push_api_key = "Your app-level Push API key"