blob: 87ae0d72bd548671a74e25a3e46f1ef7e4410026 [file] [log] [blame]
Wei-Yu Chenad55cb82022-02-15 20:07:01 +08001// SPDX-FileCopyrightText: 2013 Prometheus Team.
2// SPDX-FileCopyrightText: 2020 The Magma Authors.
3// SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
4//
5// SPDX-License-Identifier: Apache-2.0
6
7syntax = "proto2";
8
9package io.prometheus.client;
10option java_package = "io.prometheus.client";
11
12// !!!!!!!!!!!!!
13// DO NOT MODIFY
14// !!!!!!!!!!!!!
15// This file is a copy of the open source prometheus library.
16// https://github.com/prometheus/client_model/blob/master/metrics.proto
17// The 'go_package' change is made locally, and needs to be upstreamed.
18option go_package = "github.com/prometheus/client_model/go";
19
20message LabelPair {
21 optional string name = 1;
22 optional string value = 2;
23}
24
25enum MetricType {
26 COUNTER = 0;
27 GAUGE = 1;
28 SUMMARY = 2;
29 UNTYPED = 3;
30 HISTOGRAM = 4;
31}
32
33message Gauge {
34 optional double value = 1;
35}
36
37message Counter {
38 optional double value = 1;
39}
40
41message Quantile {
42 optional double quantile = 1;
43 optional double value = 2;
44}
45
46message Summary {
47 optional uint64 sample_count = 1;
48 optional double sample_sum = 2;
49 repeated Quantile quantile = 3;
50}
51
52message Untyped {
53 optional double value = 1;
54}
55
56message Histogram {
57 optional uint64 sample_count = 1;
58 optional double sample_sum = 2;
59 repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.
60}
61
62message Bucket {
63 optional uint64 cumulative_count = 1; // Cumulative in increasing order.
64 optional double upper_bound = 2; // Inclusive.
65}
66
67message Metric {
68 repeated LabelPair label = 1;
69 optional Gauge gauge = 2;
70 optional Counter counter = 3;
71 optional Summary summary = 4;
72 optional Untyped untyped = 5;
73 optional Histogram histogram = 7;
74 optional int64 timestamp_ms = 6;
75}
76
77message MetricFamily {
78 optional string name = 1;
79 optional string help = 2;
80 optional MetricType type = 3;
81 repeated Metric metric = 4;
82}