Commit 62ec1d02 authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'am-usage-data-add-hostname-metric' into 'master'

Add HostnameMetric in usage data

See merge request gitlab-org/gitlab!60256
parents 25c73c95 cb42bdae
......@@ -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
it 'includes counts keys' do
......
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