1
0
Fork 0
mirror of https://github.com/Luzifer/promcertcheck.git synced 2024-11-14 02:32:43 +00:00
promcertcheck/vendor/github.com/prometheus/client_model/ruby
Knut Ahlers 328cc40d38
Switch to dep for dependency managment, update deps
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-11-05 16:06:22 +01:00
..
lib/prometheus/client Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
.gitignore Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
Gemfile Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
LICENSE Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
Makefile Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
prometheus-client-model.gemspec Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
Rakefile Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01:00
README.md Switch to dep for dependency managment, update deps 2017-11-05 16:06:22 +01: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