github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/logproto/metrics.proto (about)

     1  syntax = "proto3";
     2  
     3  package logproto;
     4  
     5  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
     6  import "pkg/logproto/logproto.proto";
     7  
     8  option go_package = "github.com/grafana/loki/pkg/logproto";
     9  option (gogoproto.marshaler_all) = true;
    10  option (gogoproto.unmarshaler_all) = true;
    11  
    12  message WriteRequest {
    13    repeated TimeSeries timeseries = 1 [
    14      (gogoproto.nullable) = false,
    15      (gogoproto.customtype) = "PreallocTimeseries"
    16    ];
    17    enum SourceEnum {
    18      API = 0;
    19      RULE = 1;
    20    }
    21    SourceEnum Source = 2;
    22    repeated MetricMetadata metadata = 3 [(gogoproto.nullable) = true];
    23  
    24    bool skip_label_name_validation = 1000; //set intentionally high to keep WriteRequest compatible with upstream Prometheus
    25  }
    26  
    27  message WriteResponse {}
    28  
    29  message TimeSeries {
    30    repeated LegacyLabelPair labels = 1 [
    31      (gogoproto.nullable) = false,
    32      (gogoproto.customtype) = "LabelAdapter"
    33    ];
    34    // Sorted by time, oldest sample first.
    35    repeated LegacySample samples = 2 [(gogoproto.nullable) = false];
    36    // repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false];
    37  }
    38  
    39  message MetricMetadata {
    40    enum MetricType {
    41      UNKNOWN = 0;
    42      COUNTER = 1;
    43      GAUGE = 2;
    44      HISTOGRAM = 3;
    45      GAUGEHISTOGRAM = 4;
    46      SUMMARY = 5;
    47      INFO = 6;
    48      STATESET = 7;
    49    }
    50  
    51    MetricType type = 1;
    52    string metric_family_name = 2;
    53    string help = 4;
    54    string unit = 5;
    55  }
    56  
    57  message Metric {
    58    repeated LegacyLabelPair labels = 1 [
    59      (gogoproto.nullable) = false,
    60      (gogoproto.customtype) = "LabelAdapter"
    61    ];
    62  }