Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prometheus-community/postgres_exporter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: camptocamp/postgres_exporter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jul 20, 2020

  1. Recover when connection cannot be established straight at startup

    When the connection to the PostgreSQL instance cannot be established straight
    at startup, a race condition can happen when autoDiscoverDatabases is true. If
    discoverDatabaseDSNs fails, no dsn is set as the master database, and, if
    scrapeDSN succeeds, checkMapVersions will have omitted the default metrics in
    the server metric map. The metric map won't be updated unless the version
    returned by the PostgreSQL instance changes. With this patch, scrapeDSN won't
    be run unless discoverDatabaseDSNs succeeded and thus the race condition is
    eliminated.
    
    Signed-off-by: Yann Soubeyrand <[email protected]>
    yann-soubeyrand committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    91c5150 View commit details
    Browse the repository at this point in the history
  2. Do not try to return metric descriptors in Describe

    Since we cannot know in advance the metrics which the exporter will generate,
    the workaround is to run a Collect and return the metric descriptors. This is
    problematic when the connection to the PostgreSQL instance cannot be
    established straight from the start. This patch makes Describe return no
    descriptors, effectively turning the collector in an unchecked one, which we're
    in the typical use case here:
    https://pkg.go.dev/github.com/prometheus/client_golang/prometheus?tab=doc#hdr-Custom_Collectors_and_constant_Metrics.
    
    Signed-off-by: Yann Soubeyrand <[email protected]>
    yann-soubeyrand committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    0923698 View commit details
    Browse the repository at this point in the history
Loading