Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 29-Jan-2019 | - | ||||
lib/prometheus/client/ | H | 29-Jan-2019 | - | 123 | 97 | |
.gitignore | H A D | 29-Jan-2019 | 45 | 6 | 5 | |
Gemfile | H A D | 29-Jan-2019 | 108 | 5 | 3 | |
LICENSE | H A D | 29-Jan-2019 | 10.6 KiB | 202 | 169 | |
Makefile | H A D | 29-Jan-2019 | 411 | 18 | 12 | |
README.md | H A D | 29-Jan-2019 | 789 | 30 | 19 | |
Rakefile | H A D | 29-Jan-2019 | 28 | 2 | 1 | |
prometheus-client-model.gemspec | H A D | 29-Jan-2019 | 830 | 23 | 18 |
README.md
1# Prometheus Ruby client model 2 3Data model artifacts for the [Prometheus Ruby client][1]. 4 5## Usage 6 7Build the artifacts from the protobuf specification: 8 9 make build 10 11While this Gem's main purpose is to define the Prometheus data types for the 12[client][1], it's possible to use it without the client to decode a stream of 13delimited protobuf messages: 14 15```ruby 16require 'open-uri' 17require 'prometheus/client/model' 18 19CONTENT_TYPE = 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited' 20 21content = open('http://localhost:9100/metrics', 'Accept' => CONTENT_TYPE).read 22buffer = Beefcake::Buffer.new(content) 23 24while family = Prometheus::Client::MetricFamily.read_delimited(buffer) 25 puts family 26end 27``` 28 29[1]: https://github.com/prometheus/client_ruby 30