1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14syntax = "proto3"; 15 16package cobalt; 17 18import "cobalt/proto/metric_definition.proto"; 19 20option java_multiple_files = true; 21option java_package = "com.google.cobalt"; 22 23//////////////////////////////////////////////////////////////////////////////// 24// NOTE: This file is used by the Cobalt client and the Cobalt servers. 25// The source-of-truth of this file is located in Cobalt's open source code 26// repository, and the file is copied to Android where it is used by the Cobalt 27// client. Do not edit the copy of this file in this Android repo as those edits 28// will be overwritten when the file is next copied. 29//////////////////////////////////////////////////////////////////////////////// 30 31// ProjectConfigFile is a representation of a yaml config file for a single 32// cobalt project. 33message ProjectConfigFile { 34 reserved 1, 2, 3; 35 36 // Cobalt metric registration. 37 repeated MetricDefinition metric_definitions = 4; 38 39 // Metric IDs that have been previously used and deleted from this project. 40 // These IDs must not be reused in new metrics. 41 repeated uint32 deleted_metric_ids = 5; 42} 43 44// Configuration for the Cobalt projects of a customer. 45message CustomerConfig { 46 string customer_name = 1; 47 uint32 customer_id = 2; 48 repeated ProjectConfig projects = 3; 49 50 // If no experiments_namespaces are specified for individual projects, the 51 // customer's experiments namespaces are used as default. 52 repeated string experiments_namespaces = 4; 53 54 // Project IDs that have been previously used and deleted from this customer. 55 // These IDs must not be reused in new projects. 56 repeated uint32 deleted_project_ids = 5; 57} 58 59// Configuration for a Cobalt project. 60message ProjectConfig { 61 string project_name = 1; 62 uint32 project_id = 2; 63 repeated MetricDefinition metrics = 3; 64 string project_contact = 4; 65 66 // Experiment namespaces supported for experiment ids in this project. 67 repeated string experiments_namespaces = 5; 68 69 // Metric IDs that have been previously used and deleted from this project. 70 // These IDs must not be reused in new metrics. 71 repeated uint32 deleted_metric_ids = 6; 72} 73 74// CobaltRegistry holds a set of metrics and reports registered with Cobalt. 75// 76// A CobaltRegistry can be in one of two states: 77// 78// (1) It can contain data for a single Cobalt project. In this case, there is a 79// single 80// CustomerConfig which contains a single ProjectConfig. 81// 82// (2) It can contain data for multiple Cobalt projects. In this case, there may 83// be any number of 84// |customers|, which in turn may contain any number of ProjectConfigs. 85message CobaltRegistry { 86 reserved 1, 2, 3, 4; 87 // Cobalt customer registration. 88 repeated CustomerConfig customers = 5; 89} 90