opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
Sort labelset to ensure compatibility with thanos-receive
We're using thanos-receive which requires labels to be sorted lexicographically. Trying to submit a metric without first sorting the label list results in the write request being rejected, yielding the message Out of order labels in the label set.
This PR fixes this behaviour.
Please note I only tested this on thanos-remote, could use testing on other implementations.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: emdneto / name: Emídio Neto (5e062f7bc7efe91824709f590ffb79bea726d685, 852d9dccd98361514fc5eb1c7481937b9b1b2fee)
- :white_check_mark: login: fstolba / name: fst0 (186c4d7f8b58fb977fdab870c118469926672b35)
- :white_check_mark: login: lzchen / name: Leighton Chen (e9423e6d29e0b264e42842a08bca185c7209499f)
- :white_check_mark: login: xrmx / name: Riccardo Magliocchetti (71189f6617ad5bc38a1aa79ace679513c1af3dd2)
@fstolba You need to sign the CLA in order to have your changes integrated
Hello guys,
i also faced this issue and confirm that the commit proposed by @fstolba fixes this timeseries error !
Sorry for the delay, CLA is now signed.
@fstolba Have you looked into adding a test (or an assert to an existing one) to check that the labels are sorted?
I tested the solution proposed in https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2784 with my thanos receiver, and it works for me. I print the labels and the order is correct.
@fstolba
Please add a CHANGELOG entry.