You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've configured the gem in a Rails App and default metrics seem to be working fine. However, If I try to do something like this:
def index
gauge = Prometheus::Client::Gauge.new(:room_temperature_celsius, '...')
gauge.set({ room: 'kitchen' }, 21.534)
result = User.find_by(username: params[:username])
if result.nil?
render json: { msg: 'Error user name not found' }, status: :not_found
else
render json: result
end
end
The metric does not show in /metrics path.
Is there any I'm doing wrong?
Thank you!
The text was updated successfully, but these errors were encountered:
You did not register the created gauge metric with the registry. See the readme for an explanation.
Metrics shouldn't be created inside of a Rails action method, as these will be called during every request. Instead, register the metrics once and keep a reference to it.
Hi!
I've configured the gem in a Rails App and default metrics seem to be working fine. However, If I try to do something like this:
The metric does not show in
/metrics
path.Is there any I'm doing wrong?
Thank you!
The text was updated successfully, but these errors were encountered: