kops/vendor/github.com/prometheus/client_model/ruby
Justin Santa Barbara 27e68d23f6 Include vendored dependencies
glide just has too many edge-cases still, sadly.
2016-07-05 00:03:07 -04:00
..
lib/prometheus/client Include vendored dependencies 2016-07-05 00:03:07 -04:00
.gitignore Include vendored dependencies 2016-07-05 00:03:07 -04:00
Gemfile Include vendored dependencies 2016-07-05 00:03:07 -04:00
LICENSE Include vendored dependencies 2016-07-05 00:03:07 -04:00
Makefile Include vendored dependencies 2016-07-05 00:03:07 -04:00
README.md Include vendored dependencies 2016-07-05 00:03:07 -04:00
Rakefile Include vendored dependencies 2016-07-05 00:03:07 -04:00
prometheus-client-model.gemspec Include vendored dependencies 2016-07-05 00:03:07 -04:00

README.md

Prometheus Ruby client model

Data model artifacts for the Prometheus Ruby client.

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, it's possible to use it without the client to decode a stream of delimited protobuf messages:

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