elastic / elastic/integrations

[postgresql.statement] Missing database name in metrics prevents dashboard filtering

Open
#17,283 0 comments 0 reactions 0 assignees View on GitHub
bug Integration:postgresql Team:Obs-InfraObs
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
3d 4h
Merged PRs (30d)
209

Description

### Integration Name

PostgreSQL [postgresql]

### Dataset Name

postgresql.statement

### Integration Version

1.32.1

### Agent Version

9.2.3

### Agent Output Type

elasticsearch

### Elasticsearch Version

9.2.3

### OS Version and Architecture

RHEL 9 (x86_64)

### Software/API Version

Suse Linux 15 SP7 (Kernel 6.4.0 x86_64)

### Error Message

On the Dashboard "Database Overview", the panels "Query Latency" and "Top Queries" show no results, when using the provided control to filter for a database name.

### Event Original

_No response_

### What did you do?

We created a PostgreSQL integration using the default configuration, except for the Database connection string (`postgres://localhost:64001/postgres?sslmode=disable`), user name and password. We verified that all data streams found in the documentation are created and populated with data.

We then opened the mentioned dashboard and filtered for a specific database. No matter which one we chose, the mentioned panels would remain empty. Even when filtering for `exists` on the builtin control, the panels are empty.

### What did you see?

The dashboard shows all values initially, but after filtering using the builtin control, the Panels using the `postgresql.statement` data remain blank.

### What did you expect to see?

I would expect these panels to show the statement data from the filtered database.

### Anything else?

In the [metricbeat documentation](https://www.elastic.co/docs/reference/beats/metricbeat/metricbeat-metricset-postgresql-statement#_fields) the database name is missing for `statement` metrics. We suspect that this is the root issue. The database OID is present, so filtering with that would work and both panels show data.

Since it's more readable to the customer, I'd like the statement data to also contain the database name. Right now we need to either do an enrichment or clone the dashboard and change it to e.g. ESQL to join in the database name ourselves.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.