Skip to content

fix: improved postgres version parsing for explain plans in database_observability component#5131

Merged
rgeyer merged 5 commits intomainfrom
rgeyer/dbo11y/fix/psql-version
Jan 5, 2026
Merged

fix: improved postgres version parsing for explain plans in database_observability component#5131
rgeyer merged 5 commits intomainfrom
rgeyer/dbo11y/fix/psql-version

Conversation

@rgeyer
Copy link
Contributor

@rgeyer rgeyer commented Dec 16, 2025

PR Description

Effectively any version string that wasn't a very traditional semver string was failing to parse. This would impact many installations but was called out specifically for a Percona DB and a postgres docker image.

Specifically, these strings had "extra" bits at the end of the version string which semver was treating as part of the minor version.

PR Checklist

  • Tests updated

BEGIN_COMMIT_OVERRIDE
fix(database_observability): Improve postgres version parsing for explain plans in database_observability component (#5131)
END_COMMIT_OVERRIDE

@rgeyer rgeyer requested a review from a team as a code owner December 16, 2025 19:43
@rgeyer rgeyer changed the title database_observability: Improved postgres version parsing for explain plans fix: (database_observability) Improved postgres version parsing for explain plans Dec 16, 2025
@rgeyer rgeyer changed the title fix: (database_observability) Improved postgres version parsing for explain plans fix: improved postgres version parsing for explain plans in database_observability component Dec 16, 2025
running: atomic.NewBool(false),
}, nil
}
// Pre-sanitize the version a bit before semver gets it
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "a bit" is not very clear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, hopefully it is more informative now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test for the exact versions that are failing today?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did do, on lines 2293-2305. That said, this is just one of the failing version strings, but it's one I directly experienced with the postgres docker image.

I didn't get a chance to grab the full Percona version number that's failing, but the error is the same, semver is trying to parse spaces and special characters as a minor version. The changes (and the test) account for basically any combination of that.

@rgeyer rgeyer requested a review from matthewnolf December 17, 2025 19:19
Copy link
Contributor

@cristiangreco cristiangreco left a comment

Choose a reason for hiding this comment

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

Approving as I see Matt's comments have been addressed already

@rgeyer rgeyer merged commit 23c7f37 into main Jan 5, 2026
45 checks passed
@rgeyer rgeyer deleted the rgeyer/dbo11y/fix/psql-version branch January 5, 2026 16:37
@grafana-alloybot grafana-alloybot bot mentioned this pull request Jan 5, 2026
blewis12 pushed a commit that referenced this pull request Jan 6, 2026
…observability component (#5131)

* Move semver parsing of postgres version into explain plan collector to facilitate better testing

* More guardrails for parsing the postgres versions with semver to support more possible/probable version strings

* More useful comments

* Add percona version string test
blewis12 pushed a commit that referenced this pull request Jan 6, 2026
…observability component (#5131)

* Move semver parsing of postgres version into explain plan collector to facilitate better testing

* More guardrails for parsing the postgres versions with semver to support more possible/probable version strings

* More useful comments

* Add percona version string test
blewis12 pushed a commit that referenced this pull request Jan 7, 2026
…observability component (#5131)

* Move semver parsing of postgres version into explain plan collector to facilitate better testing

* More guardrails for parsing the postgres versions with semver to support more possible/probable version strings

* More useful comments

* Add percona version string test
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants