Commit 88cf7733 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'bvl-reintroduce-prometheus-spec' into 'master'

Reintroduce prometheus spec

See merge request gitlab-org/gitlab!47508
parents 4126e9e2 c4f15e21
......@@ -32,20 +32,20 @@ module Gitlab
end
def self.http_requests_total
@http_requests_total ||= ::Gitlab::Metrics.counter(:http_requests_total, 'Request count')
::Gitlab::Metrics.counter(:http_requests_total, 'Request count')
end
def self.rack_uncaught_errors_count
@rack_uncaught_errors_count ||= ::Gitlab::Metrics.counter(:rack_uncaught_errors_total, 'Request handling uncaught errors count')
::Gitlab::Metrics.counter(:rack_uncaught_errors_total, 'Request handling uncaught errors count')
end
def self.http_request_duration_seconds
@http_request_duration_seconds ||= ::Gitlab::Metrics.histogram(:http_request_duration_seconds, 'Request handling execution time',
::Gitlab::Metrics.histogram(:http_request_duration_seconds, 'Request handling execution time',
{}, [0.05, 0.1, 0.25, 0.5, 0.7, 1, 2.5, 5, 10, 25])
end
def self.http_health_requests_total
@http_health_requests_total ||= ::Gitlab::Metrics.counter(:http_health_requests_total, 'Health endpoint request count')
::Gitlab::Metrics.counter(:http_health_requests_total, 'Health endpoint request count')
end
def self.initialize_metrics
......
......@@ -127,7 +127,7 @@ RSpec.describe Gitlab::Metrics::RequestsRackMiddleware, :aggregate_failures do
end
end
describe '.initialize_metrics', :prometheus, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/281164', type: :investigating } do
describe '.initialize_metrics', :prometheus do
it "sets labels for http_requests_total" do
expected_labels = []
......
......@@ -365,7 +365,7 @@ RSpec.configure do |config|
end
config.before(:example, :prometheus) do
matching_files = File.join(::Prometheus::Client.configuration.multiprocess_files_dir, "*.db")
matching_files = File.join(::Prometheus::Client.configuration.multiprocess_files_dir, "**/*.db")
Dir[matching_files].map { |filename| File.delete(filename) if File.file?(filename) }
Gitlab::Metrics.reset_registry!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment