Skip to content

fix(gcp_exporter): preserve colons in extra_filters filter expressions#5018

Merged
kgeckhart merged 3 commits intografana:mainfrom
Kim-Yukyung:fix/4186
Dec 11, 2025
Merged

fix(gcp_exporter): preserve colons in extra_filters filter expressions#5018
kgeckhart merged 3 commits intografana:mainfrom
Kim-Yukyung:fix/4186

Conversation

@Kim-Yukyung
Copy link
Contributor

@Kim-Yukyung Kim-Yukyung commented Dec 5, 2025

PR Description

This PR fixes an issue in the prometheus.exporter.gcp component where colon (:) characters inside extra_filters values were being removed due to the previous parsing logic. By switching to strings.SplitN(filter, ":", 2), colons inside filter expressions (e.g., project_id:database_name) are now preserved correctly.

Which issue(s) this PR fixes

Fixes #4186

Notes to the Reviewer

The previous implementation relied on utils.SplitExtraFilter, which incorrectly removed colon characters from filter expressions. The updated logic only splits on the first colon, ensuring that metric prefix extraction remains correct while preserving all remaining colons in the filter query. No behavior changes outside of extra_filters parsing.

PR Checklist

  • CHANGELOG.md updated
  • Tests updated

BEGIN_COMMIT_OVERRIDE
fix(gcp_exporter): Preserve colons in extra_fiilters filter expressions (#5018)

Co-authored-by: Kyle Eckhart kgeckhart@users.noreply.github.com
END_COMMIT_OVERRIDE

@Kim-Yukyung Kim-Yukyung requested a review from a team as a code owner December 5, 2025 16:52
@CLAassistant
Copy link

CLAassistant commented Dec 5, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@kgeckhart kgeckhart left a comment

Choose a reason for hiding this comment

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

TYVM, as long as CI is green would you be able to rebase for the changelog?

@Kim-Yukyung
Copy link
Contributor Author

@kgeckhart Sure! I’ve rebased the branch to update the changelog. Please let me know if there’s anything else you’d like me to adjust. Thanks!

@kgeckhart kgeckhart merged commit 398365d into grafana:main Dec 11, 2025
39 checks passed
@Kim-Yukyung Kim-Yukyung deleted the fix/4186 branch December 11, 2025 14:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2025
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.

Colon symbol gets removed from the filter query

3 participants