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 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} 83