• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..29-Jan-2019-

lib/prometheus/client/H29-Jan-2019-12397

.gitignoreH A D29-Jan-201945 65

GemfileH A D29-Jan-2019108 53

LICENSEH A D29-Jan-201910.6 KiB202169

MakefileH A D29-Jan-2019411 1812

README.mdH A D29-Jan-2019789 3019

RakefileH A D29-Jan-201928 21

prometheus-client-model.gemspecH A D29-Jan-2019830 2318

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