Here is a set of correct metrics
cat metrics.prom
# HELP http_requests_total The total number of HTTP requests.
# TYPE http_requests_total counter
http_requests_total{method="post",code="200"} 1027 1395066363000
http_requests_total{method="post",code="400"} 3 1395066363000
cat metrics.prom | promtool check metrics
Then it is supposed to be compressed by snappy as the manual said
The read and write protocols both use a snappy-compressed protocol buffer
encoding over HTTP.
So,
snzip metrics.prom
Then
curl --header "Content-Type: application/openmetrics-text" \
--header "Content-Encoding: snappy" \
--request POST \
--data-binary "@metrics.prom.sz" \
"http://localhost:9090/api/v1/write"
but unfortunately, the result is
snappy: corrupt input
Why is it corrupt?
snzip -d metrics.prom.sz
gives perfectly fine result.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/aebacc17-b38b-4c96-9b03-9df5219c8859n%40googlegroups.com.