github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ts/catalog/chart_catalog.proto (about) 1 // Copyright 2019 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 syntax = "proto2"; 12 package cockroach.ts.catalog; 13 option go_package = "catalog"; 14 15 import "ts/tspb/timeseries.proto"; 16 17 import "gogoproto/gogo.proto"; 18 import "prometheus/client_model/metrics.proto"; 19 20 // AxisUnits describes the Unit options available in the Admin UI. It is defined here 21 // as opposed to importing the value from the Admin UI because the existing pb doesn't 22 // include an UNSET value, which we use to check for defaults. 23 enum AxisUnits { 24 // UNSET_UNITS expresses that the metric's DisplayUnit wasn't explicitly set. 25 UNSET_UNITS = 0; 26 // COUNT expresses that the metric's measurement is a count. 27 COUNT = 1; 28 // BYTES expresses that the metric's measurement is in bytes. 29 BYTES = 2; 30 // DURATION expresses that the metric's measurement represents some unit of time. 31 DURATION = 3; 32 } 33 34 // DescribeAggregator works as a proxy for cockroach.ts.tspb.TimeSeriesQueryAggregator 35 // which does not support an unset zero value. 36 enum DescribeAggregator { 37 // UNSET_AGG expresses that the Aggregator value wasn't explicitly set and should 38 // use the default value for the respective metric type defined in chart_catalog.go. 39 UNSET_AGG = 0; 40 // AVG returns the average value of datapoints. 41 AVG = 1; 42 // SUM returns the sum value of datapoints. 43 SUM = 2; 44 // MAX returns the maximum value of datapoints. 45 MAX = 3; 46 // MIN returns the minimum value of datapoints. 47 MIN = 4; 48 } 49 50 // DescribeDerivative works as a proxy for cockroach.ts.tspb.TimeSeriesQueryDerivative 51 // which has an ambiguous zero value; it's unclear if the value isn't set or if it 52 // is intentionally set to NONE. 53 enum DescribeDerivative { 54 // UNSET_DER expresses that the Derivative value wasn't explicitly set and should 55 // use the default value for the respective metric type defined in chart_catalog.go. 56 UNSET_DER = 0; 57 // NONE does not apply a derivative function. 58 NONE = 1; 59 // DERIVATIVE returns the first-order derivative of values in the time series. 60 DERIVATIVE = 2; 61 // NON_NEGATIVE_DERIVATIVE returns only non-negative values of the first-order 62 // derivative; negative values are returned as zero. This should be used for 63 // counters that monotonically increase, but might wrap or reset. 64 NON_NEGATIVE_DERIVATIVE = 3; 65 } 66 67 // ChartMetric converts cockroach.util.metric.Metadata 68 // into a struct that's useful for generating Admin UI charts. 69 message ChartMetric { 70 // name is the name of the metric. 71 required string name = 1 [(gogoproto.nullable) = false]; 72 // help is the help text from the metric. 73 required string help = 2 [(gogoproto.nullable) = false]; 74 // axisLabel is the label for the metric's y-axis. 75 required string axisLabel = 3 [(gogoproto.nullable) = false]; 76 // preferredUnits describes the units the chart should be viewed with 77 // e.g. BYTES for storage. 78 required AxisUnits preferredUnits = 4 [(gogoproto.nullable) = false]; 79 // metricType describes the type of metric this is; all metrics on a chart 80 // should be of the same type to ensure the information displays behaves in 81 // expected ways. 82 optional io.prometheus.client.MetricType metricType = 5 [(gogoproto.nullable) = false]; 83 } 84 85 // IndividualChart describes both the properties necessary to display 86 // AdminUI charts, as well as a key to find them (collectionName). 87 message IndividualChart { 88 // title is the title of the chart. 89 required string title = 1 [(gogoproto.nullable) = false]; 90 // longname displays the chart's organization within the catalog, 91 // as well as its own name. 92 required string longTitle = 2 [(gogoproto.nullable) = false]; 93 // collectionName uniquely identifies a chart. 94 required string collectionTitle = 3 [(gogoproto.nullable) = false]; 95 // downsampler specifies the chart's downsampler function. 96 required cockroach.ts.tspb.TimeSeriesQueryAggregator downsampler = 4; 97 // aggregator specifies the chart's aggregator function. 98 required cockroach.ts.tspb.TimeSeriesQueryAggregator aggregator = 5; 99 // derivative specifies the chart's derivative function. 100 required cockroach.ts.tspb.TimeSeriesQueryDerivative derivative = 6; 101 // units specifies the Admin UI units to display the chart with. 102 required AxisUnits units = 7 [(gogoproto.nullable) = false]; 103 // axisLabel defines the chart's y-axis label. 104 required string axisLabel = 8 [(gogoproto.nullable) = false]; 105 // percentiles specifies whether the chart should have its metrics broken 106 // out into percentiles; applies only to histograms. 107 required bool percentiles = 9 [(gogoproto.nullable) = false]; 108 // metrics specifies the metics the chart should display. 109 repeated ChartMetric metrics = 10 [(gogoproto.nullable) = false]; 110 } 111 112 // ChartSections organize charts into groups that contain slices or charts and 113 // other subsections. 114 message ChartSection { 115 // title is the title of the section. 116 required string title = 1 [(gogoproto.nullable) = false]; 117 // longname displays the section's organization within the catalog. 118 required string longTitle = 2 [(gogoproto.nullable) = false]; 119 // collectionName uniquely identifies a section. 120 required string collectionTitle = 3 [(gogoproto.nullable) = false]; 121 // description describes how to interpret the relationship of subsections 122 // and charts. It's only planned use is in the catalog page for Level 0 123 // sections. 124 required string description = 4 [(gogoproto.nullable) = false]; 125 // level represents the section's depth in the catalog's organization. 126 required int32 level = 5 [(gogoproto.nullable) = false]; 127 // subsections are deeper levels of the chart's organization. 128 repeated ChartSection subsections = 6; 129 // charts are the IndividualCharts that are grouped into this section. 130 repeated IndividualChart charts = 7; 131 } 132