Skip to content

Metrics not collected #29

@Pegorino82

Description

@Pegorino82

Hi! I use yabeda-rb + yabeda-rails + yabeda-sidekiq

gem 'yabeda'
gem 'yabeda-rails'
gem 'yabeda-sidekiq'
gem 'yabeda-prometheus'
gem "prometheus-client" 

on /metrics i see all of rails, sidekiq and my custom metrics

# HELP sidekiq_jobs_waiting_count The number of jobs waiting to process in sidekiq.
sidekiq_jobs_waiting_count{queue="default"} 12.0
...
# TYPE rails_requests_total counter
# HELP rails_requests_total A counter of the total number of HTTP requests rails processed.
rails_requests_total{controller="...",action="...",status="200",format="json",method="post"} 2.0
...
# TYPE git_git_tag gauge
# HELP git_git_tag Current git tag of the application.
git_git_tag{tag="..."} 1.0

but when i call

Yabeda.collect!
Prometheus::Client::Push.new(job: JOB_NAME, gateway: PROMETHEUS_URL).add(Yabeda::Prometheus.registry)

it pushes only sidekiq + default metrics, for rails metrics are not collected

...
# TYPE rails_requests_total counter
# HELP rails_requests_total A counter of the total number of HTTP requests rails processed.
# TYPE rails_request_duration_seconds histogram
# HELP rails_request_duration_seconds A histogram of the response latency.
# TYPE rails_view_runtime_seconds histogram
# HELP rails_view_runtime_seconds A histogram of the view rendering time.
# TYPE rails_db_runtime_seconds histogram
# HELP rails_db_runtime_seconds A histogram of the activerecord execution time.
...

in console it looks like

pry(main)> Yabeda.collect!
Cache read: metrics ({:compress=>true, :compress_threshold=>1024, :expires_in=>15 minutes})
Cache generate: metrics ({:compress=>true, :compress_threshold=>1024, :expires_in=>15 minutes})
Cache write: metrics ({:compress=>true, :compress_threshold=>1024, :expires_in=>15 minutes})
=> [#<Proc:0x00007f9d42be01b8 /usr/local/bundle/gems/yabeda-sidekiq-0.12.0/lib/yabeda/sidekiq.rb:67>,
 #<Proc:0x00007f9d42bf68f0 .../config/initializers/yabeda_metrics.rb:11>,
 #<Proc:0x00007f9d42bf5450 .../initializers/yabeda_metrics.rb:23>]

is there way to correctly collect all metrics for pushgateway?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions