prometheus/scrape
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
..
testdata Use SAN in test certificate (#7789) 2020-08-12 23:15:38 +02:00
helpers_test.go Append sparse histograms into the Head block (#9013) 2021-06-29 20:08:46 +05:30
manager.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
manager_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
scrape.go Hacky implementation of protobuf parsing 2021-07-01 01:35:11 +02:00
scrape_test.go Hacky implementation of protobuf parsing 2021-07-01 01:35:11 +02:00
target.go SD: Add target creation failure counter and change failure handling (#8786) 2021-05-28 23:50:59 +02:00
target_test.go SD: Add target creation failure counter and change failure handling (#8786) 2021-05-28 23:50:59 +02:00