Coder Social home page Coder Social logo

Comments (9)

deepthawtz avatar deepthawtz commented on May 16, 2024

maybe this is OK (Prometheus can ingest this JSON) but confused me because in a bare Rack app /metrics is returned in plain text.

from client_ruby.

grobie avatar grobie commented on May 16, 2024

@deepthawtz Which client version do you use? JSON support has been removed in v0.5.0 https://github.com/prometheus/client_ruby/releases/tag/v0.5.0

from client_ruby.

grobie avatar grobie commented on May 16, 2024

Text format was added in v0.3.0, so you seem to use a version between v0.3.0 and v0.5.0. The server uses HTTP content negotiation and will prefer text over json. The Prometheus server >= v1.0.0 doesn't support JSON anymore.

I strongly suggest to update your client library version, also have a look at the README. It's recommended to add a Gzip middleware as described there.

from client_ruby.

deepthawtz avatar deepthawtz commented on May 16, 2024

in my Gemfile.lock I see prometheus-client (0.6.0)

from client_ruby.

deepthawtz avatar deepthawtz commented on May 16, 2024

steps to reproduce:

  1. rails new poo
  2. add gem 'prometheus-client' to Gemfile && bundle install
  3. update config/application.rb and add
require "prometheus/client/rack/collector"
require "prometheus/client/rack/exporter"
# ... in Rails::Application configuration
   config.middleware.use Prometheus::Client::Rack::Collector
   config.middleware.use Prometheus::Client::Rack::Exporter

from client_ruby.

deepthawtz avatar deepthawtz commented on May 16, 2024

ah... basically won't work w/o Rack::Deflater I see now.. thanks

from client_ruby.

grobie avatar grobie commented on May 16, 2024

@deepthawtz What? How's that possible, the code path to respond with JSON is not longer available in v0.6.0. Can you double check that you don't have an older gem version installed and that your server really uses 0.6.0? Maybe log the client version puts Prometheus::Client::VERSION.

Please re-open if you see a 0.6.0 client responding with JSON format.

from client_ruby.

deepthawtz avatar deepthawtz commented on May 16, 2024

odd. I see:

uninitialized constant Prometheus::Client::VERSION (NameError)

but

gem list | grep prometheus
prometheus-client (0.6.0)

no other versions are installed

and the prometheus-client code on disk definitely has lib/prometheus/client/version.rb with VERSION set to 0.6.0

still digging...

from client_ruby.

grobie avatar grobie commented on May 16, 2024

You might need to require the file first:

require 'prometheus/client/version'; puts Prometheus::Client::VERSION

On Wed, Aug 31, 2016 at 12:22 PM Dylan Clendenin [email protected]
wrote:

odd. I see:

uninitialized constant Prometheus::Client::VERSION (NameError)

but

gem list | grep prometheus
prometheus-client (0.6.0)

no other versions are installed

and the prometheus-client code on disk definitely has
lib/prometheus/client/version.rb

still digging...


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAANaBAKE0qW6RkpQBcvskry42WSi177ks5qlapCgaJpZM4Jxs2r
.

from client_ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.