Skip to content

[postgresql] Apply condition setting to the statement data stream - #22295

Merged
ishleenk17 merged 4 commits into
mainfrom
postgresql-statement-condition-ik
Nov 5, 2026
Merged

ishleenk17 merged 4 commits into
mainfrom
postgresql-statement-condition-ik

Conversation

@ishleenk17

Copy link
Copy Markdown
Member

Proposed commit message

[postgresql] Apply condition setting to the statement data stream

The condition var is declared on the postgresql/metrics input and is rendered by the activity, bgwriter, database and log stream templates, but the statement template did not render it. As a result, the statement metricset ignored the configured condition (for example ${host.name} == 'node-a') and kept running on hosts where the condition evaluated to false, while the other data streams were correctly skipped.

This adds the same {{#if condition}} block to data_stream/statement/agent/stream/stream.yml.hbs, matching the other streams, and bumps the package to 1.32.2.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • Confirm the rendered statement stream contains condition: ... when the input-level condition is set.

How to test this PR locally

Add a PostgreSQL integration policy with the condition var set (e.g. ${host.name} == 'node-a') and the statement data stream enabled. The generated agent policy should now include the condition on the statement stream, as it already does for activity, bgwriter and database.

Related issues

None.


Generated by Claude Code

@ishleenk17
ishleenk17 requested a review from a team as a code owner November 5, 2026 05:59
Copilot AI balanced review requested due to automatic review settings November 5, 2026 05:59
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the PostgreSQL statement stream condition fix.

No open issues 🎉

What changed in this PR

This PR makes the PostgreSQL statement data stream honor the configured input-level condition, matching the other PostgreSQL metric streams.

Changes:

  • Render condition in the statement stream when configured.
  • Bump the package to 1.32.2 and add a bugfix changelog entry.
File Description
packages/​postgresql/​manifest.yml Bumps the package version to 1.32.2.
packages/​postgresql/​data_stream/​statement/​agent/​stream/​stream.yml.hbs Adds conditional rendering of the condition setting.
packages/​postgresql/​changelog.yml Records the statement stream condition fix.

Review effort: Balanced

@ishleenk17

Copy link
Copy Markdown
Member Author

/test

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@qcorporation qcorporation added bugfix Pull request that fixes a bug issue Integration:postgresql PostgreSQL labels Nov 5, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

@mergify

mergify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ishleenk17
ishleenk17 merged commit df3ba5e into main Nov 5, 2026
24 checks passed
@ishleenk17
ishleenk17 deleted the postgresql-statement-condition-ik branch November 5, 2026 09:58
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package postgresql - 1.32.2 containing this change is available at https://epr.elastic.co/package/postgresql/1.32.2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:postgresql PostgreSQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

⌂ 换网址