Unable to send the matrix data in Mimir via API

We are able to send logs and traces in loki and tempo but unable to send the matrix data in Mimir. As per as documentation we are transforming the json data into Bytebuffer and then compressing into snappy format for mimir but it’s not working.

We tried with multiple format all time got 400 responses from mimir with bellow error type
Error Type 1

Error: proto: illegal wireType 6

Code : 400

Failed to push metrics to Grafana Mimir.

Error Type 2

Error: unexpected EOF

Code : 400

Failed to push metrics to Grafana Mimir.

Kindly help us to resolve this issue.