Skip to content

fix: allow user to override default record stats meter attributes#71

Open
alessio-perugini wants to merge 1 commit intoexaring:mainfrom
alessio-perugini:main
Open

fix: allow user to override default record stats meter attributes#71
alessio-perugini wants to merge 1 commit intoexaring:mainfrom
alessio-perugini:main

Conversation

@alessio-perugini
Copy link

@alessio-perugini alessio-perugini commented Feb 24, 2026

Default metric attribute was appended at the end, making it impossible to override the default one from the user provided StatsOption. This commit ensure the default attributes, are always provided at the beginning, making it possible for the user to override those.

I've decided not to push a test, as it require to pull in too many deps and I did not want to pollute the library go.mod
However you can check the test in a dedicated branch I've created: https://github.com/alessio-perugini/otelpgx/tree/test-attribute-override.

Default metric attribute was appended at the end, making it impossible
to override the default one from the user provided StatsOption.
This commit ensure the default attributes, are always provided at the
beginning, making it possible for the user to override those.
@alessio-perugini alessio-perugini changed the title fix: record stats meter default attribute override fix: allow user to override default record stats meter attributes Feb 24, 2026
@alessio-perugini
Copy link
Author

@costela @obitech let me know if I should provide more context 🤓

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant