Commit cb42bdae authored by Alina Mihaila's avatar Alina Mihaila Committed by Matthias Käppler

Add HostnameMetric in usage data

parent 27621069
......@@ -8,7 +8,8 @@ product_category: collection
value_type: string
status: data_available
time_frame: none
data_source:
data_source: ruby
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::HostnameMetric'
distribution:
- ce
- ee
......
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class HostnameMetric < GenericMetric
value do
Gitlab.config.gitlab.host
end
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::HostnameMetric do
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', data_source: 'ruby' }, Gitlab.config.gitlab.host
end
......@@ -19,6 +19,7 @@ RSpec.describe Gitlab::UsageDataMetrics do
context 'whith instrumentation_class' do
it 'includes top level keys' do
expect(subject).to include(:uuid)
expect(subject).to include(:hostname)
end
end
end
......
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