From d06ed3226c8971a1c03a728efa8d1fa3f96af811 Mon Sep 17 00:00:00 2001 From: Hamas Shafiq Date: Tue, 20 Sep 2022 12:48:17 +0100 Subject: [PATCH] Jaeger: Add cheat sheet (#54521) --- .../plugins/datasource/jaeger/CheatSheet.tsx | 58 +++++++++++++++++++ .../app/plugins/datasource/jaeger/module.ts | 6 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 public/app/plugins/datasource/jaeger/CheatSheet.tsx diff --git a/public/app/plugins/datasource/jaeger/CheatSheet.tsx b/public/app/plugins/datasource/jaeger/CheatSheet.tsx new file mode 100644 index 00000000000..89329d94e66 --- /dev/null +++ b/public/app/plugins/datasource/jaeger/CheatSheet.tsx @@ -0,0 +1,58 @@ +import { css } from '@emotion/css'; +import React from 'react'; + +import { GrafanaTheme2 } from '@grafana/data'; +import { useStyles2 } from '@grafana/ui'; + +export default function CheatSheet() { + const styles = useStyles2(getStyles); + return ( + <> +

Jaeger Cheat Sheet

+

+ This cheat sheet provides a quick overview of the query types that are available. For more details about the + Jaeger data source, check out{' '} + + the documentation + + . +

+ +
+ + + ); +} + +const getStyles = (theme: GrafanaTheme2) => ({ + anchorTag: css` + color: ${theme.colors.text.link}; + `, + unorderedList: css` + list-style-type: none; + `, +}); diff --git a/public/app/plugins/datasource/jaeger/module.ts b/public/app/plugins/datasource/jaeger/module.ts index 07dca616b63..7ff12082d39 100644 --- a/public/app/plugins/datasource/jaeger/module.ts +++ b/public/app/plugins/datasource/jaeger/module.ts @@ -1,7 +1,11 @@ import { DataSourcePlugin } from '@grafana/data'; +import CheatSheet from './CheatSheet'; import { ConfigEditor } from './components/ConfigEditor'; import { QueryEditor } from './components/QueryEditor'; import { JaegerDatasource } from './datasource'; -export const plugin = new DataSourcePlugin(JaegerDatasource).setConfigEditor(ConfigEditor).setQueryEditor(QueryEditor); +export const plugin = new DataSourcePlugin(JaegerDatasource) + .setConfigEditor(ConfigEditor) + .setQueryEditor(QueryEditor) + .setQueryEditorHelp(CheatSheet);