prometheus/pkg
beorn7 5de2df752f Hacky implementation of protobuf parsing
This "brings back" protobuf parsing, with the only goal to play with
the new sparse histograms.

The Prom-2.x style parser is highly adapted to the structure of the
Prometheus text format (and later OpenMetrics). Some jumping through
hoops is required to feed protobuf into it.

This is not meant to be a model for the final implementation. It
should just enable sparse histogram ingestion at a reasonable
efficiency.

Following known shortcomings and flaws:

- No tests yet.

- Summaries and legacy histograms, i.e. without sparse buckets, are
  ignored.

- Staleness doesn't work (but this could be fixed in the appender, to
  be discussed).

- No tricks have been tried that would be similar to the tricks the
  text parsers do (like direct pointers into the HTTP response
  body). That makes things weird here. Tricky optimizations only make
  sense once the final format is specified, which will almost
  certainly not be the old protobuf format. (Interestingly, I expect
  this implementation to be in fact much more efficient than the
  original protobuf ingestion in Prom-1.x.)

- This is using a proto3 version of metrics.proto (mostly to be
  consistent with the other protobuf uses). However, proto3 sees no
  difference between an unset field. We depend on that to distinguish
  between an unset timestamp and the timestamp 0 (1970-01-01, 00:00:00
  UTC). In this experimental code, we just assume that timestamp is
  never specified and therefore a timestamp of 0 always is interpreted
  as "not set".

Signed-off-by: beorn7 <beorn@grafana.com>
2021-07-01 01:35:11 +02:00
..
exemplar Add Exemplar Remote Write support (#8296) 2021-05-06 13:53:52 -07:00
gate Fix exported function comments (#6002) 2019-09-10 14:45:09 +01:00
histogram Sparsehistogram: improve dod encoding, testing, encode chunk metadata (#9015) 2021-06-30 16:15:43 +05:30
labels Update Makefile.common 2021-04-13 09:33:45 +02:00
logging Switched to go-kit/log 2021-06-11 12:28:36 -04:00
modtimevfs *: check that assets are up-to-date (#4731) 2018-11-09 11:31:36 +01:00
pool Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
relabel Add hashmod relabeling test with hasmod and a newline 2021-03-02 23:01:22 +01:00
rulefmt fixes yamllint errors 2021-06-12 12:47:47 +02:00
runtime Fix golint issues. 2020-03-23 20:38:43 +01:00
textparse Hacky implementation of protobuf parsing 2021-07-01 01:35:11 +02:00
timestamp '@ <timestamp>' modifier (#8121) 2021-01-20 16:27:39 +05:30
value Fix spelling/typos (#4921) 2018-11-27 17:44:29 +01:00