write_prometheus plugin: New plugin for exposing metrics to Prometheus.
[collectd.git] / proto / prometheus.proto
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
14 syntax = "proto2";
15
16 package io.prometheus.client;
17 option java_package = "io.prometheus.client";
18
19 message LabelPair {
20   optional string name  = 1;
21   optional string value = 2;
22 }
23
24 enum MetricType {
25   COUNTER    = 0;
26   GAUGE      = 1;
27   SUMMARY    = 2;
28   UNTYPED    = 3;
29   HISTOGRAM  = 4;
30 }
31
32 message Gauge {
33   optional double value = 1;
34 }
35
36 message Counter {
37   optional double value = 1;
38 }
39
40 message Quantile {
41   optional double quantile = 1;
42   optional double value    = 2;
43 }
44
45 message Summary {
46   optional uint64   sample_count = 1;
47   optional double   sample_sum   = 2;
48   repeated Quantile quantile     = 3;
49 }
50
51 message Untyped {
52   optional double value = 1;
53 }
54
55 message Histogram {
56   optional uint64 sample_count = 1;
57   optional double sample_sum   = 2;
58   repeated Bucket bucket       = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.
59 }
60
61 message Bucket {
62   optional uint64 cumulative_count = 1; // Cumulative in increasing order.
63   optional double upper_bound = 2;      // Inclusive.
64 }
65
66 message Metric {
67   repeated LabelPair label        = 1;
68   optional Gauge     gauge        = 2;
69   optional Counter   counter      = 3;
70   optional Summary   summary      = 4;
71   optional Untyped   untyped      = 5;
72   optional Histogram histogram    = 7;
73   optional int64     timestamp_ms = 6;
74 }
75
76 message MetricFamily {
77   optional string     name   = 1;
78   optional string     help   = 2;
79   optional MetricType type   = 3;
80   repeated Metric     metric = 4;
81 }