...
1// Copyright 2013 Prometheus Team
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14syntax = "proto2";
15
16package io.prometheus.client;
17option java_package = "io.prometheus.client";
18option go_package = "github.com/prometheus/client_model/go;io_prometheus_client";
19
20import "google/protobuf/timestamp.proto";
21
22message LabelPair {
23 optional string name = 1;
24 optional string value = 2;
25}
26
27enum MetricType {
28 COUNTER = 0;
29 GAUGE = 1;
30 SUMMARY = 2;
31 UNTYPED = 3;
32 HISTOGRAM = 4;
33}
34
35message Gauge {
36 optional double value = 1;
37}
38
39message Counter {
40 optional double value = 1;
41 optional Exemplar exemplar = 2;
42}
43
44message Quantile {
45 optional double quantile = 1;
46 optional double value = 2;
47}
48
49message Summary {
50 optional uint64 sample_count = 1;
51 optional double sample_sum = 2;
52 repeated Quantile quantile = 3;
53}
54
55message Untyped {
56 optional double value = 1;
57}
58
59message Histogram {
60 optional uint64 sample_count = 1;
61 optional double sample_sum = 2;
62 repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.
63}
64
65message Bucket {
66 optional uint64 cumulative_count = 1; // Cumulative in increasing order.
67 optional double upper_bound = 2; // Inclusive.
68 optional Exemplar exemplar = 3;
69}
70
71message Exemplar {
72 repeated LabelPair label = 1;
73 optional double value = 2;
74 optional google.protobuf.Timestamp timestamp = 3; // OpenMetrics-style.
75}
76
77message Metric {
78 repeated LabelPair label = 1;
79 optional Gauge gauge = 2;
80 optional Counter counter = 3;
81 optional Summary summary = 4;
82 optional Untyped untyped = 5;
83 optional Histogram histogram = 7;
84 optional int64 timestamp_ms = 6;
85}
86
87message MetricFamily {
88 optional string name = 1;
89 optional string help = 2;
90 optional MetricType type = 3;
91 repeated Metric metric = 4;
92}
View as plain text