huksley / prometheus-remote-write

Send samples to prometheus via remote_write from NodeJS
MIT License
20 stars 6 forks source link

Conflict error while post multiple metrics same time got 409 Conflict error #3

Closed grootsadmin closed 1 year ago

grootsadmin commented 1 year ago

While trying to push nodejs metrics to Thanos remote write, I got a Conflict error

ERROR: Result { status: 409, statusText: 'Conflict', errorMessage: 'store locally for endpoint 127.0.0.1:12907: add 1 samples: out of order sample\n' }

AND

Result { status: 409, statusText: 'Conflict', errorMessage: 'forwarding request to endpoint 127.0.0.1:12907: rpc error: code = AlreadyExists desc = store locally for endpoint 127.0.0.1:12907: add 1 samples: out of order sample\n' }

Also tested on the updated thanos version 0.31.0 and 0.32.1 but got same error

huksley commented 1 year ago

What would be your expectations of how it can be solved? This little library just invokes endpoint with a data point you provide, and obviously there is no prediction on the order of the invocations and processing, as it executed asynchronously.

I would suggest it is a higher order problem, which better be solved by queue or some other way...

huksley commented 1 year ago

Closing because of inactivity