github.com/GuanceCloud/cliutils@v1.1.21/point/pb/point.proto (about)

     1  // Unless explicitly stated otherwise all files in this repository are licensed
     2  // under the MIT License.
     3  // This product includes software developed at Guance Cloud (https://www.guance.com/).
     4  // Copyright 2021-present Guance, Inc.
     5  
     6  // Definition of point in protobuf
     7  // Generate: see pb.sh
     8  
     9  syntax = "proto3";
    10  
    11  option go_package = "/;pb";
    12  option java_multiple_files = true;
    13  option java_outer_classname = "Point";
    14  
    15  package pb;
    16  
    17  import "google/protobuf/any.proto";
    18  
    19  // Debug used to attached some debug info for the point, these debug info
    20  // will encoded into payload, storage can take optional handle on these debug
    21  // info.
    22  message Debug {
    23  	string info = 1;
    24  }
    25  
    26  // example of pb.Any
    27  message AnyDemo {
    28  	string demo = 1;
    29  }
    30  
    31  message BasicTypes {
    32  	oneof x {
    33  			int64  i   = 1 [json_name = "i"]; // signed int
    34  			uint64 u   = 2 [json_name = "u"]; // unsigned int
    35  			double f   = 3 [json_name = "f"]; // float64
    36  			bool   b   = 4 [json_name = "b"]; // bool
    37  			bytes  d   = 5 [json_name = "d"]; // bytes, for binary data
    38  			string s   = 6 [json_name = "s"]; // string, for string data
    39  	}
    40  }
    41  
    42  message Array {
    43  	repeated BasicTypes arr = 1;
    44  }
    45  
    46  message Map {
    47  	map<string, BasicTypes> map = 1;
    48  }
    49  
    50  enum KeyType {
    51  	X   = 0; // unknown
    52  	I   = 1;
    53  	U   = 2;
    54  	F   = 3;
    55  	B   = 4;
    56  	D   = 5;
    57  	NIL = 6;
    58  	S   = 7;
    59  	A   = 8;
    60  }
    61  
    62  enum MetricType {
    63  	UNSPECIFIED = 0;
    64  	COUNT = 1;
    65  	RATE = 2;
    66  	GAUGE = 3;
    67  }
    68  
    69  message Field {
    70  
    71  	string key = 1; // field name
    72  
    73  	// See https://developers.google.com/protocol-buffers/docs/proto3#json
    74  	oneof val {
    75  			int64  i   = 2 [json_name = "i"]; // signed int
    76  			uint64 u   = 3 [json_name = "u"]; // unsigned int
    77  			double f   = 4 [json_name = "f"]; // float64
    78  			bool   b   = 5 [json_name = "b"]; // bool
    79  			bytes  d   = 6 [json_name = "d"]; // bytes, for binary data
    80  			string s   = 11 [json_name = "s"];// string, for string data
    81  
    82  			// XXX: not used
    83  			google.protobuf.Any a = 7 [json_name = "a"]; // any data
    84  	}
    85  
    86  	bool is_tag  = 8 [json_name = "is_tag"]; // set field as a tag or not
    87  
    88  	MetricType type = 9;
    89  
    90  	// field unit name
    91  	string unit = 10; // metric unit, such as bytes(B), duration(ms/us) and so on.
    92  }
    93  
    94  // Warn used to attach some warning message during building the point.
    95  message Warn {
    96  	string type = 1 [json_name="type"];
    97  	string msg = 2 [json_name="message"];
    98  }
    99  
   100  message PBPoint {
   101  	string name           = 1;
   102  	repeated Field fields = 2;
   103  	int64 time            = 3;
   104  
   105  	// Auxiliary fields for the point, they should not
   106  	// write to the final storage on production.
   107  	repeated Warn warns   = 4;
   108  	repeated Debug debugs = 5;
   109  }
   110  
   111  // batch of pbpoint.
   112  message PBPoints {
   113  	repeated PBPoint arr = 1;
   114  }