--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b3c9aaab-d85b-4b81-a922-2c2032916aac%40googlegroups.com.
byte[] compressed = Snappy.compress(payload.getBytes("UTF-8"));
LOGGER.log(Level.INFO, "Sending ="+ url + " with: \n"+ new String(Snappy.uncompress(compressed)));
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.setHeader("Content-Type", "application/x-protobuf")
.header("Content-Encoding", "snappy")
.setHeader("X-Prometheus-Remote-Write-Version", "0.1.0")
.header("User-Agent", "userAgent")
.POST(HttpRequest.BodyPublishers.ofByteArray(compressed))
.build();
Are you setting the right headers (esp. "Content-Encoding: snappy") so that the remote end knows the request is snappy-compressed? Like these here:Because your error is a protobuf decoding error referring to a wire type which protobuf itself does not define (max wire type is 5, see https://developers.google.com/protocol-buffers/docs/encoding#structure), maybe the receiving end is trying to interpret the request as protobuf without decompressing it first?
On Sun, Apr 19, 2020 at 3:52 PM Qiang Ma <muma...@gmail.com> wrote:
Hi, All,--I am trying to write a Java client to push metrics through remote_write (as I want to use PromQL to narrow down number of metrics).The receiving end is an InfluxDB and it is taking data from prometheus native "remote_write" with no problem.But when I use the Java client to post the payload (encoded with org.xerial.snappy.Snappy) and the client got this error:{"error":"proto: illegal wireType 6"}There are not much I could find how to trouble shoot to understand what's the problem... hoping there is someone in this group can lend me some tips!Thanks in advance!Regards,Qiang
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to promethe...@googlegroups.com.