File: README.md

package info (click to toggle)
golang-github-prometheus-client-model 0.0.2%2Bgit20150212.12.fa8ad6f-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 624 kB
  • sloc: xml: 122; ruby: 97; makefile: 50; python: 21
file content (31 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Prometheus Ruby client model

Data model artifacts for the [Prometheus Ruby client][1].

## Installation

    gem install prometheus-client-model

## Usage

Build the artifacts from the protobuf specification:

    make build

While this Gem's main purpose is to define the Prometheus data types for the
[client][1], it's possible to use it without the client to decode a stream of
delimited protobuf messages:

```ruby
require 'open-uri'
require 'prometheus/client/model'

CONTENT_TYPE = 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited'

stream = open('http://localhost:9090/metrics', 'Accept' => CONTENT_TYPE).read
while family = Prometheus::Client::MetricFamily.read_delimited(stream)
  puts family
end
```

[1]: https://github.com/prometheus/client_ruby