Skip to content

Commit c61dab1

Browse files
committed
apply docs suggestions
1 parent b14f0c4 commit c61dab1

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

docs/sources/reference/components/database_observability/database_observability.postgres.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,26 @@ You can use the following arguments with `database_observability.postgres`:
3535
| `enable_collectors` | `list(string)` | A list of collectors to enable on top of the default set. | | no |
3636
| `exclude_databases` | `list(string)` | A list of databases to exclude from monitoring. | | no |
3737

38-
[Data Source Name]: format must adhere to the [pq library standards](https://pkg.go.dev/github.com/lib/pq#hdr-URL_connection_strings-NewConfig).
38+
[data_source_name]: format must adhere to the [pq library standards](https://pkg.go.dev/github.com/lib/pq#hdr-URL_connection_strings-NewConfig).
3939

4040
## Exports
4141

4242
The following fields are exported and can be referenced by other components:
4343

44-
| Name | Type | Description |
45-
|------------------|---------------------|----------------------------------------------------------------------------------|
46-
| `targets` | `list(map(string))` | Targets that can be used to collect metrics from the component. |
47-
| `logs_receiver` | `LogsReceiver` | Receiver for PostgreSQL logs that processes and exports error metrics. |
44+
| Name | Type | Description |
45+
| --------------- | ------------------- | ---------------------------------------------------------------------- |
46+
| `logs_receiver` | `LogsReceiver` | Receiver for PostgreSQL logs that processes and exports error metrics. |
47+
| `targets` | `list(map(string))` | Targets that can be used to collect metrics from the component. |
4848

4949
The following collectors are configurable:
5050

5151
| Name | Description | Enabled by default |
5252
|------------------|-----------------------------------------------------------------------|--------------------|
53+
| `explain_plans` | Collect query explain plans. | yes |
54+
| `logs` | Process PostgreSQL logs and export error metrics. | yes |
5355
| `query_details` | Collect queries information. | yes |
5456
| `query_samples` | Collect query samples and wait events information. | yes |
5557
| `schema_details` | Collect schemas, tables, and columns from PostgreSQL system catalogs. | yes |
56-
| `explain_plans` | Collect query explain plans. | yes |
57-
| `logs` | Process PostgreSQL logs and export error metrics. | yes |
5858

5959
## Blocks
6060

@@ -173,18 +173,18 @@ The logs collector exports the following Prometheus metrics:
173173

174174
The collector expects PostgreSQL logs with these prefixed fields:
175175

176-
```
176+
```text
177177
<timestamp>:<remote_host:port>:<user>@<database>:[<pid>]:<line>:<SQLSTATE>:<session_start>:<vtxid>:<txid>:<session_id>:<query><app><severity>: <message>
178178
```
179179

180180
Example log line:
181-
```
181+
```text
182182
2026-02-02 21:35:40.130 UTC:10.24.155.141(34110):app_user@books_store:[32032]:2:40001:2026-02-02 21:33:19 UTC:25/112:0:693c34cb.2398::psqlERROR: canceling statement due to user request
183183
```
184184

185185
This is done by setting the log_line_prefix param to `%m:%r:%u@%d:[%p]:%l:%e:%s:%v:%x:%c:%q%a`.
186186

187-
#### How to configure the log_line_prefix
187+
#### Configure the log_line_prefix
188188

189189
**Self hosted Postgres server**
190190

@@ -203,11 +203,13 @@ SELECT pg_reload_conf();
203203
On AWS RDS, you cannot use `ALTER SYSTEM` commands. Instead, configure `log_line_prefix` via RDS Parameter Groups:
204204

205205
1. Open the AWS RDS Console → Parameter Groups
206-
2. Create or modify your parameter group
207-
3. Set `log_line_prefix` to: `%m:%r:%u@%d:[%p]:%l:%e:%s:%v:%x:%c:%q%a`
208-
4. Apply the parameter group to your RDS instance
206+
1. Create or modify your parameter group
207+
1. Set `log_line_prefix` to: `%m:%r:%u@%d:[%p]:%l:%e:%s:%v:%x:%c:%q%a`
208+
1. Apply the parameter group to your RDS instance
209209

210-
**Note:** Ensure [CloudWatch Logs export is enabled](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Procedural.UploadtoCloudWatch.html) for `Error log` and `General log` in your RDS instance settings.
210+
{{< admonition type="note" >}}
211+
Ensure [CloudWatch Logs export is enabled](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Procedural.UploadtoCloudWatch.html) for `Error log` and `General log` in your RDS instance settings.
212+
{{< /admonition >}}
211213

212214
#### Check the configuration
213215

@@ -223,7 +225,7 @@ The `logs` collector only processes logs with timestamps after the collector's s
223225

224226
**Behavior:**
225227
- On startup: Skips logs with timestamps before the collector started
226-
- Use source component features (like `storage` in `otelcol.receiver.awscloudwatch` or `positions` in `loki.source.file`) to prevent duplicate log ingestion across restarts
228+
- Relies on the source component features to prevent duplicate log ingestion across restarts
227229

228230
## Examples
229231

@@ -305,11 +307,13 @@ loki.write "logs_service" {
305307
}
306308
```
307309

308-
**Persistent storage:** Alloy's data path (`--storage.path`) must be persisted across restarts to maintain loki.source.file positions file.
310+
{{< admonition type="note" >}}
311+
**Persistent storage:** The {{< param "PRODUCT_NAME" >}} data path (`--storage.path`) must be persisted across restarts to maintain `loki.source.file` positions file.
312+
{{< /admonition >}}
309313

310-
### With otelcol.receiver.awscloudwatch
314+
### With `otelcol.receiver.awscloudwatch`
311315

312-
This needs to be used with `--stability.level=experimental`
316+
This requires `--stability.level=experimental`
313317

314318
```alloy
315319
// Storage for CloudWatch state persistence
@@ -413,7 +417,7 @@ loki.write "logs_service" {
413417
}
414418
```
415419

416-
**AWS Credentials:** The `otelcol.receiver.awscloudwatch` component requires AWS credentials. Configure via:
420+
**AWS Credentials:** The `otelcol.receiver.awscloudwatch` component requires AWS credentials. Configure with:
417421
- Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`
418422
- Docker: Mount `~/.aws` credentials or pass environment variables
419423
- Kubernetes: Use [IAM Roles for Service Accounts (IRSA)](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) or Kubernetes secrets

0 commit comments

Comments
 (0)