Skip to content

Commit af5bbbd

Browse files
cristiangrecoclayton-cornell
authored andcommitted
feat(prometheus.exporter.postgres): Update to version 0.19.0 and expose new collectors settings (#4640)
#### PR Description Update the `postgres_exporter` to version [v0.19.0](https://github.com/prometheus-community/postgres_exporter/releases/tag/v0.19.0) (but continue to use our [fork](https://github.com/grafana/postgres_exporter/tree/exporter-package-v0.19.0)). The update adds support for configuring the `stat_statements` collector flags, including `limit`, `exclude_databases`, and `exclude_users`. #### Which issue(s) this PR fixes Fixes #5502 #### Notes to the Reviewer #### PR Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [ ] CHANGELOG.md updated - [x] Documentation added - [ ] Tests updated - [ ] Config converters updated --------- Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
1 parent 729ef2f commit af5bbbd

15 files changed

Lines changed: 97 additions & 72 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.13.0"
2+
".": "1.13.1"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [1.13.1](https://github.com/grafana/alloy/compare/v1.13.0...v1.13.1) (2026-02-13)
4+
5+
6+
### Bug Fixes 🐛
7+
8+
* **database_observability.mysql:** Make query sample text nullable in MySQL query details collector [backport] ([#5519](https://github.com/grafana/alloy/issues/5519)) ([fc49bfe](https://github.com/grafana/alloy/commit/fc49bfe172aaed8a9ef5ee8bce7e639e59f432fb))
9+
* **database_observability.mysql:** Skip wait events with `NULL` timer_wait [backport] ([#5521](https://github.com/grafana/alloy/issues/5521)) ([2f43c91](https://github.com/grafana/alloy/commit/2f43c9123ef8ad75af72bd7c85dc3d08b4034ed1))
10+
* **database_observability.postgres:** Improvements to SET search_path for postgres explain plans [backport] ([#5520](https://github.com/grafana/alloy/issues/5520)) ([ecbb577](https://github.com/grafana/alloy/commit/ecbb577fce3ca5061294aae74406e98f5f2a464a))
11+
* **loki.process:** Registration of stage.metric when used inside stage.match [backport] ([#5495](https://github.com/grafana/alloy/issues/5495)) ([2bbc37e](https://github.com/grafana/alloy/commit/2bbc37e1c810d4c6c5655ec4204ff7e30a703d05))
12+
* **loki.source.docker:** Parse timestamp correctly when log line only contains newline [backport] ([#5496](https://github.com/grafana/alloy/issues/5496)) ([55a82f0](https://github.com/grafana/alloy/commit/55a82f0f634f57bbd5634e486afe276d8c176e51))
13+
* **loki.source.file:** Close file if we cannot find encoding [backport] ([#5531](https://github.com/grafana/alloy/issues/5531)) ([ccda4a5](https://github.com/grafana/alloy/commit/ccda4a50c38e230b2ed9caff718a8487da2b3f73))
14+
* **prometheus.receive_http:** Bump prometheus patch for bugfix [backport] ([#5516](https://github.com/grafana/alloy/issues/5516)) ([b3531fb](https://github.com/grafana/alloy/commit/b3531fb8730256eac7f34c877fa6cf73c5a8a60b))
15+
* **scheduling:** Shutdown runnables with a timeout before starting new ones [backport] ([#5443](https://github.com/grafana/alloy/issues/5443)) ([d446610](https://github.com/grafana/alloy/commit/d44661062d11711e9dae216fa98aaad61f027c30))
16+
317
## [1.13.0](https://github.com/grafana/alloy/compare/v1.12.1...v1.13.0) (2026-02-05)
418

519

collector/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.13.0 # x-release-please-version
1+
1.13.1 # x-release-please-version

collector/builder-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist:
22
module: github.com/grafana/alloy/otel_engine
33
name: alloy
44
description: Alloy OTel Collector distribution.
5-
version: v1.13.0 # x-release-please-version
5+
version: v1.13.1 # x-release-please-version
66
output_path: .
77

88
extensions:
@@ -122,8 +122,8 @@ replaces:
122122
- github.com/thanos-io/objstore => github.com/grafana/objstore v0.0.0-20250210100727-533688b5600d
123123
# TODO - remove forks when changes are merged upstream — non-singleton cadvisor
124124
- github.com/google/cadvisor => github.com/grafana/cadvisor grafana-v0.54.1-noglobals
125-
# TODO - track exporter-package-v0.18.1 branch of grafana fork; remove once merged upstream
126-
- github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363
125+
# TODO - this tracks exporter-package-v0.19.0 branch of grafana fork; remove once all patches are merged upstream
126+
- github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf
127127
# TODO - remove once PR is merged upstream - https://github.com/prometheus/mysqld_exporter/pull/774
128128
- github.com/prometheus/mysqld_exporter => github.com/grafana/mysqld_exporter v0.17.2-0.20250226152553-be612e3fdedd
129129
# TODO: replace node_exporter with custom fork for multi usage. https://github.com/prometheus/node_exporter/pull/2812
@@ -144,4 +144,4 @@ replaces:
144144
- sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.20.4
145145
# Fork to grafana repo to address issue with freebsd build tags. This can be removed once https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/42645 is fixed
146146
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver => github.com/grafana/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.0.0-20260126095124-0af81a9e8966
147-
# END GENERATED REPLACES
147+
# END GENERATED REPLACES

collector/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,10 @@ require (
772772
github.com/prometheus/client_golang v1.23.2 // indirect
773773
github.com/prometheus/client_golang/exp v0.0.0-20251212205219-7ba246a648ca // indirect
774774
github.com/prometheus/client_model v0.6.2 // indirect
775-
github.com/prometheus/common v0.67.4 // indirect
775+
github.com/prometheus/common v0.67.5 // indirect
776776
github.com/prometheus/common/assets v0.2.0 // indirect
777777
github.com/prometheus/consul_exporter v0.8.0 // indirect
778-
github.com/prometheus/exporter-toolkit v0.15.0 // indirect
778+
github.com/prometheus/exporter-toolkit v0.15.1 // indirect
779779
github.com/prometheus/memcached_exporter v0.13.0 // indirect
780780
github.com/prometheus/mysqld_exporter v0.17.2 // indirect
781781
github.com/prometheus/node_exporter v1.9.1 // indirect
@@ -1060,7 +1060,7 @@ replace github.com/thanos-io/objstore => github.com/grafana/objstore v0.0.0-2025
10601060

10611061
replace github.com/google/cadvisor => github.com/grafana/cadvisor v0.0.0-20260204200106-865a22723970
10621062

1063-
replace github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363
1063+
replace github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf
10641064

10651065
replace github.com/prometheus/mysqld_exporter => github.com/grafana/mysqld_exporter v0.17.2-0.20250226152553-be612e3fdedd
10661066

collector/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,8 +1179,8 @@ github.com/grafana/opentelemetry-ebpf-profiler v0.0.202602-0.20260123050037-c33a
11791179
github.com/grafana/opentelemetry-ebpf-profiler v0.0.202602-0.20260123050037-c33a6e86a2f5/go.mod h1:oqSk8XwYnL4saX2ZdpfnTJV9vURSNaVjK6yomOAVIPI=
11801180
github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8=
11811181
github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls=
1182-
github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363 h1:/vCopugIegPx9brm+E9+4bMQ6uIsZujCoE7su3bLLbk=
1183-
github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363/go.mod h1:dOdKpz09HRMtkSs8kba90eNmrL81E+LMotcP7eW9/ek=
1182+
github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf h1:GaBnxd6zH0+QaZuMBWra2MdjKUWTI8edIQx1dXMLau8=
1183+
github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf/go.mod h1:4zH24t6LEqkdL3ZfBTtp0kGHOBr6komR55CrmL2AAg4=
11841184
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg=
11851185
github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
11861186
github.com/grafana/pyroscope/api v1.2.0 h1:SfHDZcEZ4Vbj/Jj3bTOSpm4IDB33wLA2xBYxROhiL4U=
@@ -2110,16 +2110,16 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9
21102110
github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
21112111
github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
21122112
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
2113-
github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc=
2114-
github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
2113+
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
2114+
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
21152115
github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM=
21162116
github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
21172117
github.com/prometheus/consul_exporter v0.8.0 h1:2z3drFic65WFoHaJRKkmnJRRlBLmmxVqT8L9LO2yxAo=
21182118
github.com/prometheus/consul_exporter v0.8.0/go.mod h1:KHTgkT1/oLpXKC4+mKZV63hZSMHuKskUnHoenEave4Y=
21192119
github.com/prometheus/exporter-toolkit v0.7.0/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
21202120
github.com/prometheus/exporter-toolkit v0.7.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
2121-
github.com/prometheus/exporter-toolkit v0.15.0 h1:Pcle5sSViwR1x0gdPd0wtYrPQENBieQAM7TmT0qtb2U=
2122-
github.com/prometheus/exporter-toolkit v0.15.0/go.mod h1:OyRWd2iTo6Xge9Kedvv0IhCrJSBu36JCfJ2yVniRIYk=
2121+
github.com/prometheus/exporter-toolkit v0.15.1 h1:XrGGr/qWl8Gd+pqJqTkNLww9eG8vR/CoRk0FubOKfLE=
2122+
github.com/prometheus/exporter-toolkit v0.15.1/go.mod h1:P/NR9qFRGbCFgpklyhix9F6v6fFr/VQB/CVsrMDGKo4=
21232123
github.com/prometheus/memcached_exporter v0.13.0 h1:d246RYODFCXy39XA8S2PBrqp5jLCSvl9b4KsYspDCHk=
21242124
github.com/prometheus/memcached_exporter v0.13.0/go.mod h1:fp7Wk6v0RFijeP3Syvd1TShBSJoCG5iFfvPdi5dCMEU=
21252125
github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos=

dependency-replacements.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ replaces:
7979
dependency: github.com/google/cadvisor
8080
replacement: github.com/grafana/cadvisor grafana-v0.54.1-noglobals
8181

82-
- comment: TODO - track exporter-package-v0.18.1 branch of grafana fork; remove once merged upstream
82+
- comment: TODO - this tracks exporter-package-v0.19.0 branch of grafana fork; remove once all patches are merged upstream
8383
dependency: github.com/prometheus-community/postgres_exporter
84-
replacement: github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363
84+
replacement: github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf
8585

8686
- comment: TODO - remove once PR is merged upstream - https://github.com/prometheus/mysqld_exporter/pull/774
8787
dependency: github.com/prometheus/mysqld_exporter

docs/sources/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Grafana Alloy
44
description: Grafana Alloy is a vendor-neutral distribution of the OTel Collector
55
weight: 350
66
cascade:
7-
ALLOY_RELEASE: v1.13.0 # x-release-please-version
7+
ALLOY_RELEASE: v1.13.1 # x-release-please-version
88
OTEL_VERSION: v0.142.0
99
PROM_WIN_EXP_VERSION: v0.31.3
1010
SNMP_VERSION: v0.29.0

docs/sources/reference/components/prometheus/prometheus.exporter.postgres.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ There are a number of environment variables that aren't recommended for use, as
4545
Refer to the [`postgres_exporter` repository](https://github.com/prometheus-community/postgres_exporter#environment-variables) for a full list of environment variables.
4646
{{< /admonition >}}
4747

48+
The `prometheus.exporter.postgres` component configures the embedded [`postgres_exporter`](https://github.com/prometheus-community/postgres_exporter) to run with a collection timeout of 10 seconds.
49+
4850
By default, the same set of metrics is enabled as in the upstream [`postgres_exporter`](https://github.com/prometheus-community/postgres_exporter/).
4951
If `custom_queries_config_path` is set, additional metrics defined in the given configuration file will be exposed.
5052
If `disable_default_metrics` is set to `true`, only the metrics defined in the `custom_queries_config_path` file will be exposed.
@@ -132,10 +134,13 @@ The `stat_statements` block configures the selection of both the query ID and th
132134
This configuration takes effect only when the `stat_statements` collector is enabled.
133135

134136
The following arguments are supported:
135-
| Name | Type | Description | Default | Required |
136-
| --------------- | -------- | --------------------------------------------------- | ------- | -------- |
137-
| `include_query` | `bool` | Enable the selection of query ID and SQL statement. | `false` | no |
138-
| `query_length` | `number` | Maximum length of the statement query text. | `120` | no |
137+
| Name | Type | Description | Default | Required |
138+
| ------------------- | -------------- | --------------------------------------------------- | ------- | -------- |
139+
| `exclude_databases` | `list(string)` | Comma-separated list of database names to exclude. | `[]` | no |
140+
| `exclude_users` | `list(string)` | Comma-separated list of user names to exclude. | `[]` | no |
141+
| `include_query` | `bool` | Enable the selection of query ID and SQL statement. | `false` | no |
142+
| `limit` | `number` | Maximum number of statements to fetch. | `100` | no |
143+
| `query_length` | `number` | Maximum length of the statement query text. | `120` | no |
139144

140145
## Exported fields
141146

extension/alloyengine/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,9 @@ require (
732732
github.com/prometheus/client_golang v1.23.2 // indirect
733733
github.com/prometheus/client_golang/exp v0.0.0-20251212205219-7ba246a648ca // indirect
734734
github.com/prometheus/client_model v0.6.2 // indirect
735-
github.com/prometheus/common v0.67.4 // indirect
735+
github.com/prometheus/common v0.67.5 // indirect
736736
github.com/prometheus/consul_exporter v0.8.0 // indirect
737-
github.com/prometheus/exporter-toolkit v0.15.0 // indirect
737+
github.com/prometheus/exporter-toolkit v0.15.1 // indirect
738738
github.com/prometheus/memcached_exporter v0.13.0 // indirect
739739
github.com/prometheus/mysqld_exporter v0.17.2 // indirect
740740
github.com/prometheus/node_exporter v1.9.1 // indirect
@@ -1033,8 +1033,8 @@ replace github.com/thanos-io/objstore => github.com/grafana/objstore v0.0.0-2025
10331033
// TODO - remove forks when changes are merged upstream — non-singleton cadvisor
10341034
replace github.com/google/cadvisor => github.com/grafana/cadvisor v0.0.0-20260204200106-865a22723970
10351035

1036-
// TODO - track exporter-package-v0.18.1 branch of grafana fork; remove once merged upstream
1037-
replace github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20250930111128-c8f6a9f4d363
1036+
// TODO - this tracks exporter-package-v0.19.0 branch of grafana fork; remove once all patches are merged upstream
1037+
replace github.com/prometheus-community/postgres_exporter => github.com/grafana/postgres_exporter v0.0.0-20260212092411-d256e52d0faf
10381038

10391039
// TODO - remove once PR is merged upstream - https://github.com/prometheus/mysqld_exporter/pull/774
10401040
replace github.com/prometheus/mysqld_exporter => github.com/grafana/mysqld_exporter v0.17.2-0.20250226152553-be612e3fdedd

0 commit comments

Comments
 (0)