github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/proto/v3/metric_descriptor.proto (about) 1 syntax = "proto3"; 2 3 package ntt.monitoring.v3; 4 5 import "edgelq-sdk/common/api/launch_stage.proto"; 6 import "edgelq-sdk/monitoring/proto/v3/common.proto"; 7 import "google/api/resource.proto"; 8 import "goten-sdk/types/meta.proto"; 9 10 option go_package = "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/metric_descriptor;metric_descriptor"; 11 option java_multiple_files = true; 12 option java_outer_classname = "MetricDescriptorProto"; 13 option java_package = "com.ntt.monitoring.pb.v3"; 14 15 // Defines a metric type and its schema. Once a metric descriptor is created, 16 // deleting or altering it stops data collection and makes the metric type's 17 // existing data unusable. 18 message MetricDescriptor { 19 option (google.api.resource) = { 20 type : "monitoring.edgelq.com/MetricDescriptor" 21 pattern : "projects/{project}/metricDescriptors/{metric_descriptor}" 22 }; 23 24 // Metadata 25 goten.types.Meta metadata = 35; 26 27 // The resource name of the metric descriptor. 28 // When creating a new instance, this field is optional and if not provided, 29 // it will be generated automatically. Last ID segment must conform to the 30 // following regex: [\\w./-]{4,128} 31 string name = 1; 32 33 // The metric type, including its DNS name prefix. The type is not 34 // URL-encoded. All user-defined metric types have the DNS name 35 // `custom.googleapis.com` or `external.googleapis.com`. Metric types should 36 // use a natural hierarchical grouping. For example: 37 // 38 // "custom.googleapis.com/invoice/paid/amount" 39 // "external.googleapis.com/prometheus/up" 40 // "appengine.googleapis.com/http/server/response_latencies" 41 string type = 8; 42 43 // associated resource_types (also used to infer defaults) 44 // examples, devices.edgelq.com/Device, watchdog.edgelq.com/Agent 45 // if not set, defaults to "global" resource type. 46 repeated string resource_types = 34; 47 48 // The set of labels that can be used to describe a specific 49 // instance of this metric type. For example, the 50 // `appengine.googleapis.com/http/server/response_latencies` metric 51 // type has a label for the HTTP response code, `response_code`, so 52 // you can look at latencies for successful responses or just 53 // for responses that failed. 54 repeated LabelDescriptor labels = 2; 55 56 // Whether the metric records instantaneous values, changes to a value, etc. 57 // Some combinations of `metric_kind` and `value_type` might not be supported. 58 MetricKind metric_kind = 3; 59 60 // Whether the measurement is an integer, a floating-point number, etc. 61 // Some combinations of `metric_kind` and `value_type` might not be supported. 62 ValueType value_type = 4; 63 64 // The unit in which the metric value is reported. It is only applicable 65 // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The 66 // supported units are a subset of [The Unified Code for Units of 67 // Measure](http://unitsofmeasure.org/ucum.html) standard: 68 // 69 // **Basic units (UNIT)** 70 // 71 // * `bit` bit 72 // * `By` byte 73 // * `s` second 74 // * `min` minute 75 // * `h` hour 76 // * `d` day 77 // 78 // **Prefixes (PREFIX)** 79 // 80 // * `k` kilo (10**3) 81 // * `M` mega (10**6) 82 // * `G` giga (10**9) 83 // * `T` tera (10**12) 84 // * `P` peta (10**15) 85 // * `E` exa (10**18) 86 // * `Z` zetta (10**21) 87 // * `Y` yotta (10**24) 88 // * `m` milli (10**-3) 89 // * `u` micro (10**-6) 90 // * `n` nano (10**-9) 91 // * `p` pico (10**-12) 92 // * `f` femto (10**-15) 93 // * `a` atto (10**-18) 94 // * `z` zepto (10**-21) 95 // * `y` yocto (10**-24) 96 // * `Ki` kibi (2**10) 97 // * `Mi` mebi (2**20) 98 // * `Gi` gibi (2**30) 99 // * `Ti` tebi (2**40) 100 // 101 // **Grammar** 102 // 103 // The grammar also includes these connectors: 104 // 105 // * `/` division (as an infix operator, e.g. `1/s`). 106 // * `.` multiplication (as an infix operator, e.g. `GBy.d`) 107 // 108 // The grammar for a unit is as follows: 109 // 110 // Expression = Component { "." Component } { "/" Component } ; 111 // 112 // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 113 // | Annotation 114 // | "1" 115 // ; 116 // 117 // Annotation = "{" NAME "}" ; 118 // 119 // Notes: 120 // 121 // * `Annotation` is just a comment if it follows a `UNIT` and is 122 // equivalent to `1` if it is used alone. For examples, 123 // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. 124 // * `NAME` is a sequence of non-blank printable ASCII characters not 125 // containing '{' or '}'. 126 // * `1` represents dimensionless value 1, such as in `1/s`. 127 // * `%` represents dimensionless value 1/100, and annotates values giving 128 // a percentage. 129 string unit = 5; 130 131 // A detailed description of the metric, which can be used in documentation. 132 string description = 6; 133 134 // A concise name for the metric, which can be displayed in user interfaces. 135 // Use sentence case without an ending period, for example "Request count". 136 // This field is optional but it is recommended to be set for any metrics 137 // associated with user-visible concepts, such as Quota. 138 string display_name = 7; 139 140 // Optional. Metadata which can be used to guide usage of the metric. 141 MetricDescriptorMetadata metric_descriptor_metadata = 10; 142 143 // Distribution bucketing options - define only when ValueType is 144 // Distribution. Used for validating input. 145 Distribution.BucketOptions distribution_bucket_options = 31; 146 147 // Promoted Label Key Sets allow defining multiple indexing rules for 148 // underlying backend enabling query optimizations. Metric promoted label sets 149 // are combined with MonitoredResource promoted label sets and result in 150 // PromotedKeySet. 151 repeated LabelKeySet promoted_label_key_sets = 32; 152 153 // Indexing allows tweaking storage usage by tweaking amount of "duplicate" 154 // data with different promotion criteria. It's important consideration for 155 // balancing time series query performance and storage cost. 156 IndexSpec index_spec = 36; 157 158 // Storage settings 159 StorageConfig storage_config = 33; 160 161 // Additional annotations that can be used to guide the usage of a metric. 162 message MetricDescriptorMetadata { 163 // The launch stage of the metric definition. 164 ntt.api.LaunchStage launch_stage = 1; 165 } 166 167 message IndexSpec { 168 // PerResource index 169 repeated PerMonitoredResource per_resource = 1; 170 171 message Index { 172 // each label is of format: `{metric,resource}.labels.<label-key>`. 173 // since resource and metric labels are mixed. Full path is required. 174 repeated string promoted_labels = 2; 175 176 // whether this index is write-only and not usable for querying 177 bool write_only = 3; 178 } 179 180 message PerMonitoredResource { 181 string resource = 1; 182 183 // List of indices for given metric and resource pair 184 repeated Index indices = 2; 185 } 186 } 187 188 // Backend storage config 189 message StorageConfig { 190 // whether to store raw points 191 bool store_raw_points = 1; 192 } 193 194 // The kind of measurement. It describes how the data is reported. 195 enum MetricKind { 196 // Do not use this default value. 197 METRIC_KIND_UNSPECIFIED = 0; 198 199 // An instantaneous measurement of a value. 200 GAUGE = 1; 201 202 // The change in a value during a time interval. 203 DELTA = 2; 204 205 // A value accumulated over a time interval. Cumulative 206 // measurements in a time series should have the same start time 207 // and increasing end times, until an event resets the cumulative 208 // value to zero and sets a new start time for the following 209 // points. 210 CUMULATIVE = 3; 211 } 212 213 // The value type of a metric. 214 enum ValueType { 215 // Do not use this default value. 216 VALUE_TYPE_UNSPECIFIED = 0; 217 218 // The value is a boolean. 219 // This value type can be used only if the metric kind is `GAUGE`. 220 BOOL = 1; 221 222 // The value is a signed 64-bit integer. 223 INT64 = 2; 224 225 // The value is a double precision floating point number. 226 DOUBLE = 3; 227 228 // The value is a text string. 229 // This value type can be used only if the metric kind is `GAUGE`. 230 STRING = 4; 231 232 // The value is a [`Distribution`][google.api.Distribution]. 233 DISTRIBUTION = 5; 234 235 // The value is money. 236 MONEY = 6; 237 } 238 }