prometheus-adapter/vendor/github.com/prometheus/client_model/ruby
2017-06-26 19:23:05 +03:00
..
lib/prometheus/client Add vendor folder to git 2017-06-26 19:23:05 +03:00
.gitignore Add vendor folder to git 2017-06-26 19:23:05 +03:00
Gemfile Add vendor folder to git 2017-06-26 19:23:05 +03:00
LICENSE Add vendor folder to git 2017-06-26 19:23:05 +03:00
Makefile Add vendor folder to git 2017-06-26 19:23:05 +03:00
prometheus-client-model.gemspec Add vendor folder to git 2017-06-26 19:23:05 +03:00
Rakefile Add vendor folder to git 2017-06-26 19:23:05 +03:00
README.md Add vendor folder to git 2017-06-26 19:23:05 +03:00

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