opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Sort labelset to ensure compatibility with thanos-receive

Open fstolba opened this issue 1 year ago • 5 comments

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.

fstolba avatar Aug 07 '24 08:08 fstolba

CLA Signed

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

xrmx avatar Aug 19 '24 12:08 xrmx

Hello guys,

i also faced this issue and confirm that the commit proposed by @fstolba fixes this timeseries error !

image

dsarazin avatar Sep 10 '24 13:09 dsarazin

Sorry for the delay, CLA is now signed.

fstolba avatar Sep 15 '24 20:09 fstolba

@fstolba Have you looked into adding a test (or an assert to an existing one) to check that the labels are sorted?

xrmx avatar Sep 20 '24 11:09 xrmx

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.

giuseka avatar Oct 22 '24 12:10 giuseka

@fstolba

Please add a CHANGELOG entry.

lzchen avatar Oct 24 '24 16:10 lzchen