diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 277145ce0..1124007bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,10 +31,10 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.mod - - name: Build - run: make crossbuild - name: Set version run: echo "${{ needs.calculate-tag.outputs.tag }}" | sed s/v//g > VERSION + - name: Build + run: make crossbuild - name: Package run: make crossbuild-tarballs - name: Archive artifacts diff --git a/VERSION b/VERSION deleted file mode 100644 index 1985d9141..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.15.3 diff --git a/cmd/postgres_exporter/main.go b/cmd/postgres_exporter/main.go index 3c4148ba2..b21bb82b8 100644 --- a/cmd/postgres_exporter/main.go +++ b/cmd/postgres_exporter/main.go @@ -57,8 +57,8 @@ var ( excludeDatabases = kingpin.Flag("exclude-databases", "A list of databases to remove when autoDiscoverDatabases is enabled (DEPRECATED)").Default("").Envar("PG_EXPORTER_EXCLUDE_DATABASES").String() includeDatabases = kingpin.Flag("include-databases", "A list of databases to include when autoDiscoverDatabases is enabled (DEPRECATED)").Default("").Envar("PG_EXPORTER_INCLUDE_DATABASES").String() metricPrefix = kingpin.Flag("metric-prefix", "A metric prefix can be used to have non-default (not \"pg\") prefixes for each of the metrics").Default("pg").Envar("PG_EXPORTER_METRIC_PREFIX").String() - maxOpenConnections = kingpin.Flag("max-connections", "the maximum number of opened connections").Default("-1").Envar("PG_MAX_CONNECTIONS").Int() - maxIdleConnections = kingpin.Flag("max-idle-connections", "the maximum number of idle connections").Default("-1").Envar("PG_MAX_IDLE_CONNECTIONS").Int() + maxOpenConnections = kingpin.Flag("max-connections", "the maximum number of opened connections").Default("10").Envar("PG_MAX_CONNECTIONS").Int() + maxIdleConnections = kingpin.Flag("max-idle-connections", "the maximum number of idle connections").Default("5").Envar("PG_MAX_IDLE_CONNECTIONS").Int() collectorTimeout = kingpin.Flag("collector-timeout", "the single collector scrape timeout").Default("10s").Envar("PG_COLLECTOR_TIMEOUT").Duration() logger = log.NewNopLogger() ) diff --git a/cmd/postgres_exporter/postgres_exporter.go b/cmd/postgres_exporter/postgres_exporter.go index 81068a559..d4549d0e8 100644 --- a/cmd/postgres_exporter/postgres_exporter.go +++ b/cmd/postgres_exporter/postgres_exporter.go @@ -540,7 +540,12 @@ func NewExporter(dsn []string, opts ...ExporterOpt) *Exporter { } e.setupInternalMetrics() - e.servers = NewServers(ServerWithLabels(e.constantLabels)) + e.servers = NewServers( + ServerWithLabels(e.constantLabels), + ServerWithMaxIdleConnections(*maxIdleConnections), + ServerWithMaxOpenConnections(*maxOpenConnections), + ServerWithScrapeTimeout(e.scrapeTimeout), + ) return e }