Using the prometheus_exporter I wanted to check if the metrics I calculate are correctly set when I navigate to /metrics. Is there a way to test this with rspec request specs (or with another testing framework)? Maybe I missed some documentation, but I couldn't find any.
require 'rails_helper'
RSpec.describe 'Customer Collector', type: :request do
describe 'GET /metrics' do
it 'returns http success' do
get '/metrics'
expect(response).to have_http_status(:success)
end
end
end
Results into the following failure:
F
Failures:
1) Customer Collector GET /metrics returns http success
Failure/Error: get '/metrics'
ActionController::RoutingError:
No route matches [GET] "/metrics"
# ./spec/requests/customer_collector_request_spec.rb:8:in `block (3 levels) in <top (required)>'
Finished in 0.35432 seconds (files took 3.37 seconds to load)
1 example, 1 failure
Using the prometheus_exporter I wanted to check if the metrics I calculate are correctly set when I navigate to
/metrics
. Is there a way to test this with rspec request specs (or with another testing framework)? Maybe I missed some documentation, but I couldn't find any.Context:
spec/requests/customer_collector_request_spec.rb
Results into the following failure: