| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| syntax = "proto2"; |
| |
| option go_package = "go.chromium.org/luci/common/tsmon/ts_mon_proto"; |
| |
| package ts_mon.proto; |
| |
| import "google/protobuf/any.proto"; |
| import "google/protobuf/timestamp.proto"; |
| |
| message MetricsPayload { |
| repeated MetricsCollection metrics_collection = 1; |
| } |
| |
| message MetricsCollection { |
| repeated MetricsDataSet metrics_data_set = 1; |
| repeated RootLabels root_labels = 2; |
| |
| reserved 11; // target_schema.network_device |
| reserved 12; // target_schema.task |
| |
| message RootLabels { |
| required string key = 1; |
| oneof value { |
| string string_value = 2; |
| int64 int64_value = 3; |
| bool bool_value = 4; |
| } |
| } |
| } |
| |
| message MetricsDataSet { |
| // Metric name. |
| // Regex: ^(/[a-zA-Z0-9_-]+)+$ |
| optional string metric_name = 1; |
| repeated MetricFieldDescriptor field_descriptor = 2; |
| optional StreamKind stream_kind = 3; |
| optional ValueType value_type = 4; |
| optional string description = 5; |
| optional Annotations annotations = 6; |
| repeated MetricsData data = 7; |
| message MetricFieldDescriptor { |
| // Metric field name. |
| // Regex: ^[A-Za-z_][A-Za-z0-9_]*$ |
| optional string name = 1; |
| |
| optional FieldType field_type = 2; |
| enum FieldType { |
| STRING = 0; |
| INT64 = 1; |
| BOOL = 2; |
| } |
| } |
| } |
| |
| message MetricsData { |
| oneof value { |
| bool bool_value = 1; |
| string string_value = 2; |
| int64 int64_value = 3; |
| double double_value = 4; |
| Distribution distribution_value = 5; |
| } |
| |
| repeated MetricField field = 6; |
| message MetricField { |
| optional string name = 1; |
| |
| oneof value { |
| string string_value = 2; |
| int64 int64_value = 3; |
| bool bool_value = 4; |
| } |
| } |
| |
| optional google.protobuf.Timestamp start_timestamp = 7; |
| optional google.protobuf.Timestamp end_timestamp = 8; |
| |
| message Distribution { |
| optional int64 count = 1; |
| optional double mean = 2; |
| optional double sum_of_squared_deviation = 3; |
| optional double minimum = 4; |
| optional double maximum = 5; |
| |
| oneof bucket_options { |
| LinearOptions linear_buckets = 6; |
| ExponentialOptions exponential_buckets = 7; |
| ExplicitOptions explicit_buckets = 8; |
| } |
| |
| message LinearOptions { |
| optional int32 num_finite_buckets = 1; |
| optional double width = 2; |
| optional double offset = 3; |
| } |
| |
| message ExponentialOptions { |
| optional int32 num_finite_buckets = 1; |
| optional double growth_factor = 2; |
| optional double scale = 3; |
| } |
| |
| message ExplicitOptions { |
| repeated double bound = 1 [packed = true]; |
| } |
| |
| repeated int64 bucket_count = 9 [packed = true]; |
| |
| repeated Exemplar exemplar = 10; |
| |
| message Exemplar { |
| optional double value = 1; |
| optional google.protobuf.Timestamp timestamp = 2; |
| repeated google.protobuf.Any attachment = 3; |
| } |
| } |
| } |
| |
| message Annotations { |
| optional string unit = 1; |
| optional bool timestamp = 2; |
| optional string deprecation = 3; |
| repeated google.protobuf.Any annotation = 4; |
| } |
| |
| enum StreamKind { |
| GAUGE = 0; |
| CUMULATIVE = 1; |
| DELTA = 2; |
| } |
| |
| enum ValueType { |
| BOOL = 0; |
| STRING = 1; |
| INT64 = 2; |
| DOUBLE = 3; |
| DISTRIBUTION = 4; |
| } |