Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame] | 1 | // 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 | |
| 7 | syntax = "proto2"; |
| 8 | |
| 9 | package io.prometheus.client; |
| 10 | option 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. |
| 18 | option go_package = "github.com/prometheus/client_model/go"; |
| 19 | |
| 20 | message LabelPair { |
| 21 | optional string name = 1; |
| 22 | optional string value = 2; |
| 23 | } |
| 24 | |
| 25 | enum MetricType { |
| 26 | COUNTER = 0; |
| 27 | GAUGE = 1; |
| 28 | SUMMARY = 2; |
| 29 | UNTYPED = 3; |
| 30 | HISTOGRAM = 4; |
| 31 | } |
| 32 | |
| 33 | message Gauge { |
| 34 | optional double value = 1; |
| 35 | } |
| 36 | |
| 37 | message Counter { |
| 38 | optional double value = 1; |
| 39 | } |
| 40 | |
| 41 | message Quantile { |
| 42 | optional double quantile = 1; |
| 43 | optional double value = 2; |
| 44 | } |
| 45 | |
| 46 | message Summary { |
| 47 | optional uint64 sample_count = 1; |
| 48 | optional double sample_sum = 2; |
| 49 | repeated Quantile quantile = 3; |
| 50 | } |
| 51 | |
| 52 | message Untyped { |
| 53 | optional double value = 1; |
| 54 | } |
| 55 | |
| 56 | message 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 | |
| 62 | message Bucket { |
| 63 | optional uint64 cumulative_count = 1; // Cumulative in increasing order. |
| 64 | optional double upper_bound = 2; // Inclusive. |
| 65 | } |
| 66 | |
| 67 | message 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 | |
| 77 | message MetricFamily { |
| 78 | optional string name = 1; |
| 79 | optional string help = 2; |
| 80 | optional MetricType type = 3; |
| 81 | repeated Metric metric = 4; |
| 82 | } |