Commit af1f4022 authored by Stan Hu's avatar Stan Hu

Merge branch 'astoicescu/changeDefaultDashboardNameToOverview' into 'master'

Change default dashboard name to overview

See merge request gitlab-org/gitlab!38292
parents 41a47d19 a8c1c690
...@@ -213,7 +213,7 @@ export const annotationsSymbolIcon = 'path://m5 229 5 8h-10z'; ...@@ -213,7 +213,7 @@ export const annotationsSymbolIcon = 'path://m5 229 5 8h-10z';
* This technical debt is being tracked here * This technical debt is being tracked here
* https://gitlab.com/gitlab-org/gitlab/-/issues/214671 * https://gitlab.com/gitlab-org/gitlab/-/issues/214671
*/ */
export const DEFAULT_DASHBOARD_PATH = 'config/prometheus/common_metrics.yml'; export const OVERVIEW_DASHBOARD_PATH = 'config/prometheus/common_metrics.yml';
/** /**
* GitLab provide metrics dashboards that are available to a user once * GitLab provide metrics dashboards that are available to a user once
......
...@@ -17,7 +17,7 @@ import { convertObjectPropsToCamelCase } from '../../lib/utils/common_utils'; ...@@ -17,7 +17,7 @@ import { convertObjectPropsToCamelCase } from '../../lib/utils/common_utils';
import { s__, sprintf } from '../../locale'; import { s__, sprintf } from '../../locale';
import { getDashboard, getPrometheusQueryData, getPanelJson } from '../requests'; import { getDashboard, getPrometheusQueryData, getPanelJson } from '../requests';
import { ENVIRONMENT_AVAILABLE_STATE, DEFAULT_DASHBOARD_PATH, VARIABLE_TYPES } from '../constants'; import { ENVIRONMENT_AVAILABLE_STATE, OVERVIEW_DASHBOARD_PATH, VARIABLE_TYPES } from '../constants';
function prometheusMetricQueryParams(timeRange) { function prometheusMetricQueryParams(timeRange) {
const { start, end } = convertToFixedRange(timeRange); const { start, end } = convertToFixedRange(timeRange);
...@@ -298,7 +298,7 @@ export const receiveEnvironmentsDataFailure = ({ commit }) => { ...@@ -298,7 +298,7 @@ export const receiveEnvironmentsDataFailure = ({ commit }) => {
export const fetchAnnotations = ({ state, dispatch, getters }) => { export const fetchAnnotations = ({ state, dispatch, getters }) => {
const { start } = convertToFixedRange(state.timeRange); const { start } = convertToFixedRange(state.timeRange);
const dashboardPath = getters.fullDashboardPath || DEFAULT_DASHBOARD_PATH; const dashboardPath = getters.fullDashboardPath || OVERVIEW_DASHBOARD_PATH;
return gqClient return gqClient
.mutate({ .mutate({
mutation: getAnnotations, mutation: getAnnotations,
...@@ -331,12 +331,12 @@ export const receiveAnnotationsFailure = ({ commit }) => commit(types.RECEIVE_AN ...@@ -331,12 +331,12 @@ export const receiveAnnotationsFailure = ({ commit }) => commit(types.RECEIVE_AN
export const fetchDashboardValidationWarnings = ({ state, dispatch, getters }) => { export const fetchDashboardValidationWarnings = ({ state, dispatch, getters }) => {
/** /**
* Normally, the default dashboard won't throw any validation warnings. * Normally, the overview dashboard won't throw any validation warnings.
* *
* However, if a bug sneaks into the default dashboard making it invalid, * However, if a bug sneaks into the overview dashboard making it invalid,
* this might come handy for our clients * this might come handy for our clients
*/ */
const dashboardPath = getters.fullDashboardPath || DEFAULT_DASHBOARD_PATH; const dashboardPath = getters.fullDashboardPath || OVERVIEW_DASHBOARD_PATH;
return gqClient return gqClient
.mutate({ .mutate({
mutation: getDashboardValidationWarnings, mutation: getDashboardValidationWarnings,
......
...@@ -465,9 +465,9 @@ export const addPrefixToCustomVariableParams = name => `variables[${name}]`; ...@@ -465,9 +465,9 @@ export const addPrefixToCustomVariableParams = name => `variables[${name}]`;
* metrics dashboard to work with custom dashboard file names instead * metrics dashboard to work with custom dashboard file names instead
* of the entire path. * of the entire path.
* *
* If dashboard is empty, it is the default dashboard. * If dashboard is empty, it is the overview dashboard.
* If dashboard is set, it usually is a custom dashboard unless * If dashboard is set, it usually is a custom dashboard unless
* explicitly it is set to default dashboard path. * explicitly it is set to overview dashboard path.
* *
* @param {String} dashboard dashboard path * @param {String} dashboard dashboard path
* @param {String} dashboardPrefix custom dashboard directory prefix * @param {String} dashboardPrefix custom dashboard directory prefix
......
...@@ -6,10 +6,10 @@ module Metrics ...@@ -6,10 +6,10 @@ module Metrics
module Dashboard module Dashboard
class SelfMonitoringDashboardService < ::Metrics::Dashboard::PredefinedDashboardService class SelfMonitoringDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
DASHBOARD_PATH = 'config/prometheus/self_monitoring_default.yml' DASHBOARD_PATH = 'config/prometheus/self_monitoring_default.yml'
DASHBOARD_NAME = N_('Default dashboard') DASHBOARD_NAME = N_('Overview')
# SHA256 hash of dashboard content # SHA256 hash of dashboard content
DASHBOARD_VERSION = '1dff3e3cb76e73c8e368823c98b34c61aec0d141978450dea195a3b3dc2415d6' DASHBOARD_VERSION = '0f7ade2022e09f1a1da8e883cc95d84b9557e1e0e9b015c51eb964296aa73098'
SEQUENCE = [ SEQUENCE = [
STAGES::CustomMetricsInserter, STAGES::CustomMetricsInserter,
......
...@@ -6,7 +6,7 @@ module Metrics ...@@ -6,7 +6,7 @@ module Metrics
module Dashboard module Dashboard
class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
DASHBOARD_PATH = 'config/prometheus/common_metrics.yml' DASHBOARD_PATH = 'config/prometheus/common_metrics.yml'
DASHBOARD_NAME = N_('Default dashboard') DASHBOARD_NAME = N_('Overview')
# SHA256 hash of dashboard content # SHA256 hash of dashboard content
DASHBOARD_VERSION = '4685fe386c25b1a786b3be18f79bb2ee9828019003e003816284cdb634fa3e13' DASHBOARD_VERSION = '4685fe386c25b1a786b3be18f79bb2ee9828019003e003816284cdb634fa3e13'
......
---
title: In metrics view, change default dashboard name to Overview
merge_request: 38292
author:
type: changed
dashboard: 'Default dashboard' dashboard: 'Overview'
priority: 1 priority: 1
templating: templating:
......
...@@ -55,7 +55,7 @@ panels, provide a regular expression in the **Instance label regex** field. ...@@ -55,7 +55,7 @@ panels, provide a regular expression in the **Instance label regex** field.
The dashboard uses metrics available in The dashboard uses metrics available in
[Omnibus GitLab](https://docs.gitlab.com/omnibus/) installations. [Omnibus GitLab](https://docs.gitlab.com/omnibus/) installations.
![GitLab self monitoring default dashboard](img/self_monitoring_default_dashboard.png) ![GitLab self monitoring overview dashboard](img/self_monitoring_overview_dashboard.png)
You can also You can also
[create your own dashboards](../../../operations/metrics/dashboards/index.md). [create your own dashboards](../../../operations/metrics/dashboards/index.md).
...@@ -83,7 +83,7 @@ Once the webhook is setup, you can ...@@ -83,7 +83,7 @@ Once the webhook is setup, you can
You can add custom metrics in the self monitoring project by: You can add custom metrics in the self monitoring project by:
1. [Duplicating](../../../operations/metrics/dashboards/index.md#duplicate-a-gitlab-defined-dashboard) the default dashboard. 1. [Duplicating](../../../operations/metrics/dashboards/index.md#duplicate-a-gitlab-defined-dashboard) the overview dashboard.
1. [Editing](../../../operations/metrics/index.md) the newly created dashboard file and configuring it with [dashboard YAML properties](../../../operations/metrics/dashboards/yaml.md). 1. [Editing](../../../operations/metrics/index.md) the newly created dashboard file and configuring it with [dashboard YAML properties](../../../operations/metrics/dashboards/yaml.md).
## Troubleshooting ## Troubleshooting
......
...@@ -57,7 +57,7 @@ You can open the link directly into your browser for a ...@@ -57,7 +57,7 @@ You can open the link directly into your browser for a
## Embedding metrics in issue templates ## Embedding metrics in issue templates
You can also embed either the default dashboard metrics or individual metrics in You can also embed either the overview dashboard metrics or individual metrics in
issue templates. For charts to render side-by-side, separate links to the entire metrics issue templates. For charts to render side-by-side, separate links to the entire metrics
dashboard or individual metrics by either a comma or a space. dashboard or individual metrics by either a comma or a space.
......
...@@ -7603,9 +7603,6 @@ msgstr "" ...@@ -7603,9 +7603,6 @@ msgstr ""
msgid "Default classification label" msgid "Default classification label"
msgstr "" msgstr ""
msgid "Default dashboard"
msgstr ""
msgid "Default deletion adjourned period" msgid "Default deletion adjourned period"
msgstr "" msgstr ""
......
...@@ -165,7 +165,7 @@ RSpec.describe MetricsDashboard do ...@@ -165,7 +165,7 @@ RSpec.describe MetricsDashboard do
it 'adds starred dashboard information and sorts the list' do it 'adds starred dashboard information and sorts the list' do
all_dashboards = json_response['all_dashboards'].map { |dashboard| dashboard.slice('display_name', 'starred', 'user_starred_path') } all_dashboards = json_response['all_dashboards'].map { |dashboard| dashboard.slice('display_name', 'starred', 'user_starred_path') }
expected_response = [ expected_response = [
{ "display_name" => "Default dashboard", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: 'config/prometheus/common_metrics.yml' }) }, { "display_name" => "Overview", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: 'config/prometheus/common_metrics.yml' }) },
{ "display_name" => "anomaly.yml", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/anomaly.yml' }) }, { "display_name" => "anomaly.yml", "starred" => false, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/anomaly.yml' }) },
{ "display_name" => "errors.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/errors.yml' }) }, { "display_name" => "errors.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/errors.yml' }) },
{ "display_name" => "test.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/test.yml' }) } { "display_name" => "test.yml", "starred" => true, 'user_starred_path' => api_v4_projects_metrics_user_starred_dashboards_path(id: project.id, params: { dashboard_path: '.gitlab/dashboards/test.yml' }) }
......
...@@ -257,7 +257,7 @@ describe('Dashboard header', () => { ...@@ -257,7 +257,7 @@ describe('Dashboard header', () => {
}); });
const duplicableCases = [ const duplicableCases = [
null, // When no path is specified, it uses the default dashboard path. null, // When no path is specified, it uses the overview dashboard path.
dashboardGitResponse[0].path, dashboardGitResponse[0].path,
dashboardGitResponse[2].path, dashboardGitResponse[2].path,
selfMonitoringDashboardGitResponse[0].path, selfMonitoringDashboardGitResponse[0].path,
......
...@@ -886,7 +886,7 @@ describe('Dashboard', () => { ...@@ -886,7 +886,7 @@ describe('Dashboard', () => {
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
it('is not present for the default dashboard', () => { it('is not present for the overview dashboard', () => {
expect(findEditLink().exists()).toBe(false); expect(findEditLink().exists()).toBe(false);
}); });
...@@ -905,7 +905,7 @@ describe('Dashboard', () => { ...@@ -905,7 +905,7 @@ describe('Dashboard', () => {
describe('document title', () => { describe('document title', () => {
const originalTitle = 'Original Title'; const originalTitle = 'Original Title';
const defaultDashboardName = dashboardGitResponse[0].display_name; const overviewDashboardName = dashboardGitResponse[0].display_name;
beforeEach(() => { beforeEach(() => {
document.title = originalTitle; document.title = originalTitle;
...@@ -916,11 +916,11 @@ describe('Dashboard', () => { ...@@ -916,11 +916,11 @@ describe('Dashboard', () => {
document.title = ''; document.title = '';
}); });
it('is prepended with default dashboard name by default', () => { it('is prepended with the overview dashboard name by default', () => {
setupAllDashboards(store); setupAllDashboards(store);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(document.title.startsWith(`${defaultDashboardName} · `)).toBe(true); expect(document.title.startsWith(`${overviewDashboardName} · `)).toBe(true);
}); });
}); });
...@@ -935,11 +935,11 @@ describe('Dashboard', () => { ...@@ -935,11 +935,11 @@ describe('Dashboard', () => {
}); });
}); });
it('is prepended with default dashboard name is path is not known', () => { it('is prepended with the overview dashboard name if path is not known', () => {
setupAllDashboards(store, 'unknown/path'); setupAllDashboards(store, 'unknown/path');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(document.title.startsWith(`${defaultDashboardName} · `)).toBe(true); expect(document.title.startsWith(`${overviewDashboardName} · `)).toBe(true);
}); });
}); });
......
...@@ -73,7 +73,7 @@ describe('DashboardsDropdown', () => { ...@@ -73,7 +73,7 @@ describe('DashboardsDropdown', () => {
}); });
it('filters dropdown items when searched for item exists in the list', () => { it('filters dropdown items when searched for item exists in the list', () => {
const searchTerm = 'Default'; const searchTerm = 'Overview';
setSearchTerm(searchTerm); setSearchTerm(searchTerm);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -170,7 +170,7 @@ export const environmentData = [ ...@@ -170,7 +170,7 @@ export const environmentData = [
export const dashboardGitResponse = [ export const dashboardGitResponse = [
{ {
default: true, default: true,
display_name: 'Default', display_name: 'Overview',
can_edit: false, can_edit: false,
system_dashboard: true, system_dashboard: true,
out_of_the_box_dashboard: true, out_of_the_box_dashboard: true,
......
...@@ -380,7 +380,7 @@ describe('Monitoring store Getters', () => { ...@@ -380,7 +380,7 @@ describe('Monitoring store Getters', () => {
); );
}); });
it('returns a non-default dashboard', () => { it('returns a dashboard different from the overview dashboard', () => {
const localState = { const localState = {
allDashboards: dashboardGitResponse, allDashboards: dashboardGitResponse,
currentDashboard: dashboardGitResponse[1].path, currentDashboard: dashboardGitResponse[1].path,
...@@ -391,7 +391,7 @@ describe('Monitoring store Getters', () => { ...@@ -391,7 +391,7 @@ describe('Monitoring store Getters', () => {
); );
}); });
it('returns a default dashboard when no dashboard is selected', () => { it('returns the overview dashboard when no dashboard is selected', () => {
const localState = { const localState = {
allDashboards: dashboardGitResponse, allDashboards: dashboardGitResponse,
currentDashboard: null, currentDashboard: null,
...@@ -402,7 +402,7 @@ describe('Monitoring store Getters', () => { ...@@ -402,7 +402,7 @@ describe('Monitoring store Getters', () => {
); );
}); });
it('returns a default dashboard when dashboard cannot be found', () => { it('returns the overview dashboard when dashboard cannot be found', () => {
const localState = { const localState = {
allDashboards: dashboardGitResponse, allDashboards: dashboardGitResponse,
currentDashboard: 'wrong_path', currentDashboard: 'wrong_path',
......
...@@ -142,7 +142,7 @@ RSpec.describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store ...@@ -142,7 +142,7 @@ RSpec.describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store
describe '.find_all_paths' do describe '.find_all_paths' do
let(:all_dashboard_paths) { described_class.find_all_paths(project) } let(:all_dashboard_paths) { described_class.find_all_paths(project) }
let(:system_dashboard) { { path: system_dashboard_path, display_name: 'Default dashboard', default: true, system_dashboard: true, out_of_the_box_dashboard: true } } let(:system_dashboard) { { path: system_dashboard_path, display_name: 'Overview', default: true, system_dashboard: true, out_of_the_box_dashboard: true } }
it 'includes only the system dashboard by default' do it 'includes only the system dashboard by default' do
expect(all_dashboard_paths).to eq([system_dashboard]) expect(all_dashboard_paths).to eq([system_dashboard])
...@@ -163,7 +163,7 @@ RSpec.describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store ...@@ -163,7 +163,7 @@ RSpec.describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store
let(:self_monitoring_dashboard) do let(:self_monitoring_dashboard) do
{ {
path: self_monitoring_dashboard_path, path: self_monitoring_dashboard_path,
display_name: 'Default dashboard', display_name: 'Overview',
default: true, default: true,
system_dashboard: true, system_dashboard: true,
out_of_the_box_dashboard: true out_of_the_box_dashboard: true
......
...@@ -132,7 +132,7 @@ RSpec.describe Metrics::Dashboard::DynamicEmbedService, :use_clean_rails_memory_ ...@@ -132,7 +132,7 @@ RSpec.describe Metrics::Dashboard::DynamicEmbedService, :use_clean_rails_memory_
end end
shared_examples 'uses system dashboard' do shared_examples 'uses system dashboard' do
it 'uses the default dashboard' do it 'uses the overview dashboard' do
expect(Gitlab::Metrics::Dashboard::Finder) expect(Gitlab::Metrics::Dashboard::Finder)
.to receive(:find_raw) .to receive(:find_raw)
.with(project, dashboard_path: system_dashboard_path) .with(project, dashboard_path: system_dashboard_path)
......
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