From 370a93101ef721ed7ec30ef293b2260a5710ecae Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Tue, 24 Mar 2020 22:11:17 +0200 Subject: [PATCH] [Home][Tutorial] Add Openmetrics data UI (#61073) (#61129) --- .../tutorial_resources/logos/openmetrics.svg | 1 + .../tutorials/openmetrics_metrics/index.ts | 63 +++++++++++++++++++ src/plugins/home/server/tutorials/register.ts | 2 + 3 files changed, 66 insertions(+) create mode 100644 src/legacy/core_plugins/kibana/public/home/tutorial_resources/logos/openmetrics.svg create mode 100644 src/plugins/home/server/tutorials/openmetrics_metrics/index.ts diff --git a/src/legacy/core_plugins/kibana/public/home/tutorial_resources/logos/openmetrics.svg b/src/legacy/core_plugins/kibana/public/home/tutorial_resources/logos/openmetrics.svg new file mode 100644 index 0000000000000..feccb88a3f34b --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/home/tutorial_resources/logos/openmetrics.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/plugins/home/server/tutorials/openmetrics_metrics/index.ts b/src/plugins/home/server/tutorials/openmetrics_metrics/index.ts new file mode 100644 index 0000000000000..b0ff61c7116ce --- /dev/null +++ b/src/plugins/home/server/tutorials/openmetrics_metrics/index.ts @@ -0,0 +1,63 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { i18n } from '@kbn/i18n'; +import { TutorialsCategory } from '../../services/tutorials'; +import { + onPremInstructions, + cloudInstructions, + onPremCloudInstructions, +} from '../instructions/metricbeat_instructions'; +import { + TutorialContext, + TutorialSchema, +} from '../../services/tutorials/lib/tutorials_registry_types'; + +export function openmetricsMetricsSpecProvider(context: TutorialContext): TutorialSchema { + const moduleName = 'openmetrics'; + return { + id: 'openmetricsMetrics', + name: i18n.translate('home.tutorials.openmetricsMetrics.nameTitle', { + defaultMessage: 'OpenMetrics metrics', + }), + category: TutorialsCategory.METRICS, + shortDescription: i18n.translate('home.tutorials.openmetricsMetrics.shortDescription', { + defaultMessage: 'Fetch metrics from an endpoint that serves metrics in OpenMetrics format.', + }), + longDescription: i18n.translate('home.tutorials.openmetricsMetrics.longDescription', { + defaultMessage: + 'The `openmetrics` Metricbeat module fetches metrics from an endpoint that serves metrics in OpenMetrics format. \ +[Learn more]({learnMoreLink}).', + values: { + learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-openmetrics.html', + }, + }), + euiIconType: '/plugins/kibana/home/tutorial_resources/logos/openmetrics.svg', + artifacts: { + dashboards: [], + exportedFields: { + documentationUrl: '{config.docs.beats.metricbeat}/exported-fields-openmetrics.html', + }, + }, + completionTimeMinutes: 10, + onPrem: onPremInstructions(moduleName, context), + elasticCloud: cloudInstructions(moduleName), + onPremElasticCloud: onPremCloudInstructions(moduleName), + }; +} diff --git a/src/plugins/home/server/tutorials/register.ts b/src/plugins/home/server/tutorials/register.ts index f1a51018bfd98..b6c56a35554b2 100644 --- a/src/plugins/home/server/tutorials/register.ts +++ b/src/plugins/home/server/tutorials/register.ts @@ -87,6 +87,7 @@ import { envoyproxyMetricsSpecProvider } from './envoyproxy_metrics'; import { ibmmqMetricsSpecProvider } from './ibmmq_metrics'; import { statsdMetricsSpecProvider } from './statsd_metrics'; import { redisenterpriseMetricsSpecProvider } from './redisenterprise_metrics'; +import { openmetricsMetricsSpecProvider } from './openmetrics_metrics'; export const builtInTutorials = [ systemLogsSpecProvider, @@ -160,4 +161,5 @@ export const builtInTutorials = [ envoyproxyMetricsSpecProvider, statsdMetricsSpecProvider, redisenterpriseMetricsSpecProvider, + openmetricsMetricsSpecProvider, ];