github.com/m3db/m3@v1.5.0/src/metrics/generated/proto/rulepb/rule.proto (about) 1 // Copyright (c) 2020 Uber Technologies, Inc. 2 // 3 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // of this software and associated documentation files (the "Software"), to deal 5 // in the Software without restriction, including without limitation the rights 6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 // copies of the Software, and to permit persons to whom the Software is 8 // furnished to do so, subject to the following conditions: 9 // 10 // The above copyright notice and this permission notice shall be included in 11 // all copies or substantial portions of the Software. 12 // 13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 // THE SOFTWARE. 20 21 syntax = "proto3"; 22 23 option go_package = "github.com/m3db/m3/src/metrics/generated/proto/rulepb"; 24 25 package rulepb; 26 27 import "github.com/m3db/m3/src/metrics/generated/proto/aggregationpb/aggregation.proto"; 28 import "github.com/m3db/m3/src/metrics/generated/proto/pipelinepb/pipeline.proto"; 29 import "github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto"; 30 import "github.com/m3db/m3/src/metrics/generated/proto/metricpb/metric.proto"; 31 32 message MappingRuleSnapshot { 33 string name = 1; 34 bool tombstoned = 2; 35 int64 cutover_nanos = 3; 36 string filter = 4; 37 // TODO(xichen): remove this and mark the field number reserved once all mapping rules are updated in KV. 38 repeated policypb.Policy policies = 5; 39 int64 last_updated_at_nanos = 6; 40 string last_updated_by = 7; 41 repeated aggregationpb.AggregationType aggregation_types = 8; 42 repeated policypb.StoragePolicy storage_policies = 9; 43 policypb.DropPolicy drop_policy = 10; 44 repeated metricpb.Tag tags = 11; 45 } 46 47 message MappingRule { 48 string uuid = 1; 49 repeated MappingRuleSnapshot snapshots = 2; 50 } 51 52 // TODO(xichen): remove this once all rules are updated in KV. 53 message RollupTarget { 54 string name = 1; 55 repeated string tags = 2; 56 repeated policypb.Policy policies = 3; 57 } 58 59 // TODO(xichen): rename this once all rules are updated in KV. 60 message RollupTargetV2 { 61 pipelinepb.Pipeline pipeline = 1; 62 repeated policypb.StoragePolicy storage_policies = 2; 63 bool resend_enabled = 3; 64 } 65 66 message RollupRuleSnapshot { 67 string name = 1; 68 bool tombstoned = 2; 69 int64 cutover_nanos = 3; 70 string filter = 4; 71 // TODO(xichen): remove this and mark the field number reserved once all rollup rules are updated in KV. 72 repeated RollupTarget targets = 5; 73 int64 last_updated_at_nanos = 6; 74 string last_updated_by = 7; 75 // TODO(xichen): rename this once all rules are updated in KV. 76 repeated RollupTargetV2 targets_v2 = 8; 77 bool keep_original = 9; 78 repeated metricpb.Tag tags = 10; 79 } 80 81 message RollupRule { 82 string uuid = 1; 83 repeated RollupRuleSnapshot snapshots = 2; 84 } 85 86 message RuleSet { 87 string uuid = 1; 88 string namespace = 2; 89 int64 created_at_nanos = 3; 90 int64 last_updated_at_nanos = 4; 91 bool tombstoned = 5; 92 int64 cutover_nanos = 6; 93 repeated MappingRule mapping_rules = 7; 94 repeated RollupRule rollup_rules = 8; 95 string last_updated_by = 9; 96 }