2017-04-25 3 views
0

Prometheus Ruby Client를 실행하여 통계 값을 수집하고 Prometheus 데이터베이스에 저장하려고합니다.Prometheus Ruby Client 실행 방법

여기의 지시를 따랐습니다 : 나는 두 보석, prometheusprometheus-client을 설치 한 https://github.com/prometheus/client_ruby#rack-middleware

랙 미들웨어.

exporter.rb (https://github.com/prometheus/client_ruby/blob/master/lib/prometheus/middleware/exporter.rb)과 collector.rb (https://github.com/prometheus/client_ruby/blob/master/lib/prometheus/middleware/collector.rb) 위치에 저장됩니다 : 나는이 지역에서 config.ru (https://github.com/prometheus/client_ruby#rack-middleware)를 저장 한 prometheus/middleware

폴더. rackup -d config.ru -I /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/prometheus-client-0.6.0/lib -I /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/quantile-0.2.0/lib

- 난 문이 필요한 파일을 찾을 수 필요가 같습니다

는 그럼 난과 랙 웹 서버를 시작했습니다.

/home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/prometheus-client-0.6.0/lib -I /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/quantile-0.2.0/lib 
nil 
Exception `ArgumentError' at /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:86 - wrong number of arguments (given 2, expected 1) 
Exception `ArgumentError' at /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49 - wrong number of arguments (given 2, expected 1) 
Exception `ArgumentError' at /home/sven/.rbenv/versions/2.3.3/bin/rackup:22 - wrong number of arguments (given 2, expected 1) 
/home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/deflater.rb:20:in `initialize': wrong number of arguments (given 2, expected 1) (ArgumentError) 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:86:in `new' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:86:in `block in use' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:134:in `block in to_app' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:134:in `each' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:134:in `inject' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:134:in `to_app' 
    from /home/sven/StarPerfMonitor_v2.0.0/config.ru:13:in `<main>' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:242:in `start' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:141:in `start' 
    from /home/sven/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-1.5.5/bin/rackup:4:in `<top (required)>' 
    from /home/sven/.rbenv/versions/2.3.3/bin/rackup:22:in `load' 
    from /home/sven/.rbenv/versions/2.3.3/bin/rackup:22:in `<main>' 
+0

스택 추적을 포함하여 오류 메시지를 완료 하시겠습니까? – spickermann

답변

0

는이 문제는 너무 까다이었고, 나는 InfluxDB로 전환하기로 결정했다. 그리고 몇 분 안에 Ruby Client를 실행할 수있었습니다. 나는 프로 메테우스보다 훨씬 나을 것 같다. 죄송합니다.