From 296fd35d47d89d1f48c8f956a878fd9249732775 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Fri, 28 Sep 2018 19:12:50 +0200 Subject: [PATCH] stackdriver: add help section for annotations --- .../partials/annotations.editor.html | 23 +++++++++++++++++- .../stackdriver/partials/query.editor.html | 24 +++++++++---------- public/sass/components/_infobox.scss | 9 +++++++ 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/public/app/plugins/datasource/stackdriver/partials/annotations.editor.html b/public/app/plugins/datasource/stackdriver/partials/annotations.editor.html index 592dffacd51..0c2ce32f894 100644 --- a/public/app/plugins/datasource/stackdriver/partials/annotations.editor.html +++ b/public/app/plugins/datasource/stackdriver/partials/annotations.editor.html @@ -1,7 +1,7 @@ -
+
Title @@ -14,3 +14,24 @@
+ +
+
Annotation Query Format
+An annotation is an event that is overlaid on top of graphs. Annotation rendering is expensive so it is important to limit the number of rows returned. + +The Title and Text fields support templating and can use data returned from the query. For example, the Title field could have the following text: + +{{metric.type}} has value: {{metric.value}} + +Example Result: monitoring.googleapis.com/uptime_check/http_status has this value: 502 + + +{{metric.value}} = value of the metric/point +{{metric.type}} = metric type e.g. compute.googleapis.com/instance/cpu/usage_time +{{metric.name}} = name part of metric e.g. instance/cpu/usage_time +{{metric.service}} = service part of metric e.g. compute + +{{metric.label.label_name}} = Metric label metadata e.g. metric.label.instance_name +{{resource.label.label_name}} = Resource label metadata e.g. resource.label.zone +
+
diff --git a/public/app/plugins/datasource/stackdriver/partials/query.editor.html b/public/app/plugins/datasource/stackdriver/partials/query.editor.html index 1d3b6c93e76..95793b6e7b1 100755 --- a/public/app/plugins/datasource/stackdriver/partials/query.editor.html +++ b/public/app/plugins/datasource/stackdriver/partials/query.editor.html @@ -40,21 +40,21 @@
{{ctrl.lastQueryMeta.rawQueryString}}
-
-
Alias Patterns
- Format the legend keys any way you want by using alias patterns. +
+
Alias Patterns
Format the legend keys any way you want by using alias patterns. - Example: {{metric.name}} - {{metric.label.instance_name}} - Result: cpu/usage_time - server1-europe-west-1 +{{metric.name}} - {{metric.label.instance_name}} - Patterns: - {{metric.type}} = metric type e.g. compute.googleapis.com/instance/cpu/usage_time - {{metric.name}} = name part of metric e.g. instance/cpu/usage_time - {{metric.service}} = service part of metric e.g. compute +cpu/usage_time - server1-europe-west-1 - {{metric.label.label_name}} = Metric label metadata e.g. metric.label.instance_name - {{resource.label.label_name}} = Resource label metadata e.g. resource.label.zone -
+ +{{metric.type}} = metric type e.g. compute.googleapis.com/instance/cpu/usage_time +{{metric.name}} = name part of metric e.g. instance/cpu/usage_time +{{metric.service}} = service part of metric e.g. compute + +{{metric.label.label_name}} = Metric label metadata e.g. metric.label.instance_name +{{resource.label.label_name}} = Resource label metadata e.g. resource.label.zone +
{{ctrl.lastQueryError}}
diff --git a/public/sass/components/_infobox.scss b/public/sass/components/_infobox.scss index 9a6a2e78a4f..52be4b4737c 100644 --- a/public/sass/components/_infobox.scss +++ b/public/sass/components/_infobox.scss @@ -19,6 +19,15 @@ padding-left: $spacer * 1.5; } + code { + @include font-family-monospace(); + font-size: $font-size-base - 2; + background-color: $code-tag-bg; + color: $text-color; + border: 1px solid $code-tag-border; + border-radius: 4px; + } + a { @extend .external-link; }