opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
[proemtheus-remote-write] fix label sorting
Description
This is required by the spec "MUST have label names sorted in lexicographical order."
This library would inject the __name__ label at the end. This broke the label ordering, leading Thanos to reject the write with a "409 Conflict" error.
Type of change
Please delete options that are not relevant.
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Unit test, and tested against a Thanos instance.
Does This PR Require a Core Repo Change?
- [ ] Yes. - Link to PR:
- [x] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [x] Followed the style guidelines of this project
- [x] Changelogs have been updated
- [x] Unit tests have been added
- [x] Documentation has been updated
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: tals / name: Tal Shiri (a69529034051957a027d5731c2bafa45f2230936)
+1 thanks for making this PR @tals I had implemented the same fix on a fork and its been working well for me.
This is certainly a needed feature because Thanos chose to define and assert the missing remote-write spec - see here, one of the assertions being lexicographically sorted label names
cc'ing @lzchen