Commit 921850a0 authored by João Pereira's avatar João Pereira Committed by Stan Hu

Add container registry observations to usage ping

parent 30c1d8c9
---
title: Add container registry observations to usage ping
merge_request: 37203
author:
type: added
...@@ -737,6 +737,8 @@ appear to be associated to any of the services running, since they all appear to ...@@ -737,6 +737,8 @@ appear to be associated to any of the services running, since they all appear to
| `server` | `topology > nodes > node_services` | `enablement` | | | The type of web server used (Unicorn or Puma) | | `server` | `topology > nodes > node_services` | `enablement` | | | The type of web server used (Unicorn or Puma) |
| `network_policy_forwards` | `counts` | `defend` | | EE | Cumulative count of forwarded packets by Container Network | | `network_policy_forwards` | `counts` | `defend` | | EE | Cumulative count of forwarded packets by Container Network |
| `network_policy_drops` | `counts` | `defend` | | EE | Cumulative count of dropped packets by Container Network | | `network_policy_drops` | `counts` | `defend` | | EE | Cumulative count of dropped packets by Container Network |
| `vendor` | `container_registry` | `package` | | CE+EE | The Container Registry vendor (GitLab or third-party) |
| `version` | `container_registry` | `package` | | CE+EE | The Container Registry version (only when vendor is GitLab) |
## Example Usage Ping payload ## Example Usage Ping payload
...@@ -811,6 +813,10 @@ The following is example content of the Usage Ping payload. ...@@ -811,6 +813,10 @@ The following is example content of the Usage Ping payload.
"enabled": true, "enabled": true,
"version": "1.17.0" "version": "1.17.0"
}, },
"container_registry": {
"vendor": "gitlab",
"version": "2.9.1-gitlab"
},
"database": { "database": {
"adapter": "postgresql", "adapter": "postgresql",
"version": "9.6.15" "version": "9.6.15"
......
...@@ -254,6 +254,10 @@ module Gitlab ...@@ -254,6 +254,10 @@ module Gitlab
enabled: alt_usage_data(fallback: nil) { Gitlab.config.pages.enabled }, enabled: alt_usage_data(fallback: nil) { Gitlab.config.pages.enabled },
version: alt_usage_data { Gitlab::Pages::VERSION } version: alt_usage_data { Gitlab::Pages::VERSION }
}, },
container_registry: {
vendor: alt_usage_data(fallback: nil) { Gitlab::CurrentSettings.container_registry_vendor },
version: alt_usage_data(fallback: nil) { Gitlab::CurrentSettings.container_registry_version }
},
database: { database: {
adapter: alt_usage_data { Gitlab::Database.adapter_name }, adapter: alt_usage_data { Gitlab::Database.adapter_name },
version: alt_usage_data { Gitlab::Database.version } version: alt_usage_data { Gitlab::Database.version }
......
...@@ -575,6 +575,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -575,6 +575,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
it 'gathers basic components usage data' do it 'gathers basic components usage data' do
stub_runtime(:puma) stub_runtime(:puma)
stub_application_setting(container_registry_vendor: 'gitlab', container_registry_version: 'x.y.z')
expect(subject[:app_server][:type]).to eq('puma') expect(subject[:app_server][:type]).to eq('puma')
expect(subject[:gitlab_pages][:enabled]).to eq(Gitlab.config.pages.enabled) expect(subject[:gitlab_pages][:enabled]).to eq(Gitlab.config.pages.enabled)
...@@ -587,6 +588,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -587,6 +588,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect(subject[:gitaly][:clusters]).to be >= 0 expect(subject[:gitaly][:clusters]).to be >= 0
expect(subject[:gitaly][:filesystems]).to be_an(Array) expect(subject[:gitaly][:filesystems]).to be_an(Array)
expect(subject[:gitaly][:filesystems].first).to be_a(String) expect(subject[:gitaly][:filesystems].first).to be_a(String)
expect(subject[:container_registry][:vendor]).to eq('gitlab')
expect(subject[:container_registry][:version]).to eq('x.y.z')
end end
def stub_runtime(runtime) def stub_runtime(runtime)
......
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