Skip to content

Commit 8ff4da1

Browse files
craig[bot]dhartunian
andcommitted
Merge #155259
155259: metric: add docs guidance to proto file r=jasonlmfong a=dhartunian Epic: None Release note: None Co-authored-by: David Hartunian <davidh@cockroachlabs.com>
2 parents 9510b99 + 7fbb3aa commit 8ff4da1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

pkg/util/metric/metric.proto

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ message Metadata {
5656
// the metric. Please ensure that it is unique across the codebase even if a
5757
// labeled_name is provided.
5858
required string name = 1 [(gogoproto.nullable) = false];
59+
// help is a short description of what the metric measures. This field is
60+
// exported in the Prometheus scrape endpoint and should be concise enough
61+
// to fit in a tooltip. It should describe what is being measured and end
62+
// with a period. All metrics must have a help text.
5963
required string help = 2 [(gogoproto.nullable) = false];
6064
required string measurement = 3 [(gogoproto.nullable) = false];
6165
required Unit unit = 4 [(gogoproto.nullable) = false];
@@ -101,8 +105,17 @@ message Metadata {
101105
// category is the dashboard category of this metric. This is
102106
// required if `essential` is true.
103107
required Category category = 11 [(gogoproto.nullable) = false];
104-
// how_to_use is an extended description of how to use this metric
105-
// with a running cluster. This is required if `essential` is true.
108+
// how_to_use provides extended information about how to interpret this
109+
// metric's values in a running cluster. It should include guidance on:
110+
// - How to interpret anomalous values
111+
// - Where to follow up an investigation
112+
// - Related cluster settings or other metrics
113+
// This field is required if `essential` is true. It is NOT exported
114+
// to the Prometheus scrape endpoint, so it can be significantly
115+
// longer than the help text and may contain multiple paragraphs.
116+
// Paragraphs should wrap at 100 chars, same as code. Currently this
117+
// field is only output to metrics.yaml for documentation purposes,
118+
// with plans for future use in automated dashboard generation.
106119
required string how_to_use = 12 [(gogoproto.nullable) = false];
107120

108121
// Next ID: 10 (then 13).

0 commit comments

Comments
 (0)