-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathmetric.proto
62 lines (57 loc) · 2.51 KB
/
metric.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2018 The Cockroach Authors.
//
// Licensed 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.
// metric.proto requires proto2 to import io.prometheus.client.MetricType.
syntax = "proto2";
package cockroach.util.metric;
option go_package = "metric";
import "gogoproto/gogo.proto";
import "prometheus/client_model/metrics.proto";
// metric.LabelPair is a proxy for io.prometheus.client.LabelPair.
// io.prometheus.client.LabelPair doesn't support gogoproto.marshaler
// and gogoproto.unmarshaler which are required by gRPC. metric.LabelPair
// stores information that is similarly structured, supports the requisite
// gogoproto options, and is convertible to io.prometheus.client.LabelPair
// to satisfy PrometheusExportable's GetLabels method.
message LabelPair {
optional string name = 1;
optional string value = 2;
}
// DisplayUnit describes how the metric's units should be displayed in charts.
enum DisplayUnit {
// Unset expresses that the metric's DisplayUnit wasn't explicitly set.
UNSET = 0;
// Bytes expresses that the metric measures bytes.
BYTES = 1;
// Const expresses that the metric represents a constant value.
CONST = 2;
// Count expresses that the metric represents a count.
COUNT = 3;
// Nanoseconds expresses that the metric measures nanoseconds.
NANOSECONDS = 4;
// Percent expresses that the metric represents a percentage value.
PERCENT = 5;
// Timestamp expresses that the metric represents time since the Unix epoch.
TIMESTAMP = 6;
}
// Metadata holds metadata about a metric. It must be embedded in
// each metric object. It's used to export information about the
// metric to Prometheus and for Admin UI charts.
message Metadata {
required string name = 1 [(gogoproto.nullable) = false];
required string help = 2 [(gogoproto.nullable) = false];
required string unit = 3 [(gogoproto.nullable) = false];
required DisplayUnit displayUnit = 4 [(gogoproto.nullable) = false];
optional io.prometheus.client.MetricType metricType = 5 [(gogoproto.nullable) = false];
repeated LabelPair labels = 6;
}