Skip to content

Commit ca815e1

Browse files
authored
Add PostgreSQL integration with DB Observability support (#2205)
* Add PostgreSQL integration with DB Observability support Signed-off-by: Pete Wall <[email protected]>
1 parent efcd1db commit ca815e1

File tree

154 files changed

+33161
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+33161
-621
lines changed

.github/workflows/integration-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ jobs:
7474
id: setup-helm
7575
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
7676
continue-on-error: true
77-
with:
78-
version: 4.0.0
7977

8078
- name: Set up Homebrew
8179
if: ${{ steps.setup-helm.outcome == 'failure' }}

.github/workflows/platform-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ jobs:
8585
id: setup-helm
8686
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
8787
continue-on-error: true
88-
with:
89-
version: 4.0.0
9088

9189
- name: Set up Homebrew
9290
if: ${{ steps.setup-helm.outcome == 'failure' }}

.github/workflows/release-v1.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ jobs:
5252
id: setup-helm
5353
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
5454
continue-on-error: true
55-
with:
56-
version: 4.0.0
5755

5856
- name: Set up Homebrew
5957
if: ${{ steps.setup-helm.outcome == 'failure' }}

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ jobs:
5252
id: setup-helm
5353
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
5454
continue-on-error: true
55-
with:
56-
version: 4.0.0
5755

5856
- name: Set up Homebrew
5957
if: ${{ steps.setup-helm.outcome == 'failure' }}

.github/workflows/test-v1.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
id: setup-helm
4848
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
4949
continue-on-error: true
50-
with:
51-
version: 4.0.0
5250

5351
- name: Set up Homebrew
5452
if: ${{ steps.setup-helm.outcome == 'failure' }}
@@ -80,8 +78,6 @@ jobs:
8078
id: setup-helm
8179
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
8280
continue-on-error: true
83-
with:
84-
version: 4.0.0
8581

8682
- name: Set up chart-testing
8783
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
@@ -163,8 +159,6 @@ jobs:
163159
id: setup-helm
164160
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
165161
continue-on-error: true
166-
with:
167-
version: 4.0.0
168162

169163
- name: Set up Homebrew
170164
if: ${{ steps.setup-helm.outcome == 'failure' }}

.github/workflows/unit-test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ jobs:
9191
id: setup-helm
9292
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
9393
continue-on-error: true
94-
with:
95-
version: 4.0.0
9694

9795
- name: Set up Homebrew
9896
if: ${{ steps.setup-helm.outcome == 'failure' }}
@@ -139,8 +137,6 @@ jobs:
139137
id: setup-helm
140138
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
141139
continue-on-error: true
142-
with:
143-
version: 4.0.0
144140

145141
- name: Set up Homebrew
146142
if: ${{ steps.setup-helm.outcome == 'failure' }}

charts/k8s-monitoring/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ platform-test-checks: $(PLATFORM_TEST_OUTPUT_FILES)
183183
.PHONY: clean
184184
clean: clean-examples
185185
rm -f README.md values.schema.json templates/destinations/_destination_types.tpl schema-mods/destination.json
186-
rm -f $(COLLECTOR_SCHEMA_FILES) $(COLLECTOR_DOCS_FILES)
186+
rm -f collectors/upstream/alloy-values.yaml $(COLLECTOR_SCHEMA_FILES) $(COLLECTOR_DOCS_FILES)
187187
rm -f $(DESTINATION_SCHEMA_FILES) $(DESTINATION_DOCS_FILES)
188188
set -e && \
189189
for chart in $(FEATURE_CHARTS); do \
@@ -202,7 +202,7 @@ build-features:
202202

203203
# Build targets
204204
.PHONY: build
205-
build: build-features README.md values.schema.json templates/destinations/_destination_types.tpl $(COLLECTOR_DOCS_FILES) $(DESTINATION_DOCS_FILES) examples integration-test-checks platform-test-checks
205+
build: build-features README.md values.schema.json templates/destinations/_destination_types.tpl collectors/upstream/alloy-values.yaml $(COLLECTOR_DOCS_FILES) $(DESTINATION_DOCS_FILES) examples integration-test-checks platform-test-checks
206206

207207
# Test targets
208208
.PHONY: test unittest lint-helm lint-configs

charts/k8s-monitoring/charts/feature-integrations/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ Be sure perform actual integration testing in a live environment in the main [k8
144144
| nodeLabels.nodeRole | bool | `false` | Whether or not to add the node\_role label |
145145
| nodeLabels.region | bool | `false` | Whether or not to add the region label |
146146

147+
### Integration: PostgreSQL
148+
149+
| Key | Type | Default | Description |
150+
|-----|------|---------|-------------|
151+
| postgresql | object | `{"instances":[]}` | Scrape metrics/logs from PostgreSQL |
152+
147153
### Integration: Tempo
148154

149155
| Key | Type | Default | Description |
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# MySQL Integration
2+
3+
This integration captures the metrics and logs to collect stats from a MySQL server. This deploys the
4+
[MySQL Exporter Alloy component](https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.mysql/)
5+
which connects to the database to generate metrics.
6+
7+
This integration is also compatible with [Grafana Database Observability](https://grafana.com/docs/grafana-cloud/monitor-applications/database-observability/).
8+
9+
## Enabling
10+
11+
To enable this integration, create an instance :
12+
13+
```yaml
14+
integrations:
15+
mysql:
16+
instances:
17+
- name: test-db
18+
exporter:
19+
dataSource:
20+
host: test-db.default.svc
21+
protocol: tcp
22+
port: 3306
23+
auth:
24+
username: mysql-admin
25+
password: mysql-root-password
26+
logs:
27+
enabled: true
28+
labelSelectors:
29+
app: mysql-test-db
30+
```
31+
32+
To enable with Database Observability, enable the `databaseObservability` flag:
33+
34+
```yaml
35+
integrations:
36+
mysql:
37+
instances:
38+
- name: test-db
39+
jobLabel: integrations/db-o11y
40+
databaseObservability:
41+
enabled: true
42+
exporter:
43+
collectors:
44+
perfSchemaEventsStatements:
45+
enabled: true
46+
dataSource:
47+
host: test-db.default.svc
48+
protocol: tcp
49+
port: 3306
50+
auth:
51+
username: mysql-admin
52+
password: mysql-root-password
53+
logs:
54+
enabled: true
55+
labelSelectors:
56+
app.kubernetes.io/instance: test-mysql-db
57+
```
58+
59+
{{ template "chart.valuesSection" . }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# PostgreSQL Integration
2+
3+
This integration captures the metrics and logs to collect stats from a PostgreSQL server. This deploys the
4+
[PostgreSQL Exporter Alloy component](https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.postgres/)
5+
which connects to the database to generate metrics.
6+
7+
This integration is also compatible with [Grafana Database Observability](https://grafana.com/docs/grafana-cloud/monitor-applications/database-observability/).
8+
9+
## Enabling
10+
11+
To enable this integration, create an instance :
12+
13+
```yaml
14+
integrations:
15+
postgresql:
16+
instances:
17+
- name: test-database
18+
exporter:
19+
dataSource:
20+
host: test-database-pg-db-primary.postgresql.svc
21+
auth:
22+
username: pg-admin
23+
password: pg-admin-password
24+
logs:
25+
enabled: true
26+
labelSelectors:
27+
app.kubernetes.io/instance: test-database-pg-db
28+
```
29+
30+
To enable with Database Observability, enable the `databaseObservability` flag:
31+
32+
```yaml
33+
integrations:
34+
mysql:
35+
instances:
36+
- name: test-database
37+
jobLabel: integrations/db-o11y
38+
databaseObservability:
39+
enabled: true
40+
exporter:
41+
dataSource:
42+
host: test-database-pg-db-primary.postgresql.svc
43+
auth:
44+
username: pg-admin
45+
password: pg-admin-password
46+
logs:
47+
enabled: true
48+
labelSelectors:
49+
app.kubernetes.io/instance: test-database-pg-db
50+
```
51+
52+
{{ template "chart.valuesSection" . }}

0 commit comments

Comments
 (0)