protos/configuration/configuration.proto (169 lines of code) (raw):
/*
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
syntax = "proto3";
package workloadagent.protos.configuration;
import "google/protobuf/duration.proto";
option go_package = "github.com/GoogleCloudPlatform/workloadagent/protos/configuration";
message Configuration {
enum LogLevel {
UNDEFINED = 0;
DEBUG = 1;
INFO = 2;
WARNING = 3;
ERROR = 4;
}
string service_endpoint_override = 1;
LogLevel log_level = 2;
optional bool log_to_cloud = 3;
CloudProperties cloud_properties = 4;
AgentProperties agent_properties = 5;
OracleConfiguration oracle_configuration = 6;
MySQLConfiguration mysql_configuration = 7;
CommonDiscovery common_discovery = 8;
RedisConfiguration redis_configuration = 9;
SQLServerConfiguration sqlserver_configuration = 10;
string data_warehouse_endpoint = 11;
}
message CloudProperties {
string project_id = 1;
string instance_id = 2;
string zone = 3;
string instance_name = 4;
string image = 5;
string numeric_project_id = 6;
string region = 7; // This is needed only for baremtal systems and is not
// used for GCE instances.
string machine_type = 8;
}
message AgentProperties {
string version = 1;
string name = 2;
bool log_usage_metrics = 3;
}
message OracleConfiguration {
optional bool enabled = 1;
OracleDiscovery oracle_discovery = 2;
OracleMetrics oracle_metrics = 3;
}
message OracleDiscovery {
google.protobuf.Duration update_frequency = 1;
optional bool enabled = 2;
}
message OracleMetrics {
optional bool enabled = 1;
google.protobuf.Duration collection_frequency = 2;
repeated ConnectionParameters connection_parameters = 3;
repeated Query queries = 4;
int64 max_execution_threads = 5;
google.protobuf.Duration query_timeout = 6;
}
message MySQLConfiguration {
optional bool enabled = 1;
ConnectionParameters connection_parameters = 2;
}
message CommonDiscovery {
google.protobuf.Duration collection_frequency = 1;
}
message RedisConfiguration {
optional bool enabled = 1;
ConnectionParameters connection_parameters = 2;
}
message SQLServerConfiguration {
message CollectionConfiguration {
// defaults to True
// enables or disables guest os collection
bool collect_guest_os_metrics = 1;
// defaults to True
// enables or disables SQL Server collection
bool collect_sql_metrics = 2;
// defaults to 3600s (1 hour)
// collection frequency
google.protobuf.Duration collection_frequency = 3;
}
message CredentialConfiguration {
message GuestCredentialsRemoteWin {
ConnectionParameters connection_parameters = 1;
}
message GuestCredentialsRemoteLinux {
ConnectionParameters connection_parameters = 1;
// private key for linux remote collection
string linux_ssh_private_key_path = 2;
}
CloudProperties vm_properties = 1;
repeated ConnectionParameters connection_parameters = 2;
oneof guest_configurations {
bool local_collection = 3;
GuestCredentialsRemoteWin remote_win = 4;
GuestCredentialsRemoteLinux remote_linux = 5;
}
}
optional bool enabled = 1;
CollectionConfiguration collection_configuration = 2;
repeated CredentialConfiguration credential_configurations = 3;
// default timeout is 10s
google.protobuf.Duration collection_timeout = 4;
// default max_retries is 3
int32 max_retries = 5;
// default retry_frequency is 3600s
google.protobuf.Duration retry_frequency = 6;
// default remote collection is false
bool remote_collection = 7;
}
message ConnectionParameters {
string username = 1;
SecretRef secret = 2;
string host = 3;
int32 port = 4;
string service_name = 5;
string password = 6;
}
message SecretRef {
// The project whose Secret Manager data is being referenced.
string project_id = 1;
// Name of the secret in Cloud Secret Manager. Note: this is not the
// resource name (e.g., projects/<project>/secrets/<secret>). It's
// just the secret name, which is the last part of the resource name.
string secret_name = 2;
}
message Query {
string name = 1;
string sql = 2;
repeated Column columns = 3;
DatabaseRole database_role = 4;
enum DatabaseRole {
UNSPECIFIED = 0;
PRIMARY = 1;
STANDBY = 2;
BOTH = 3;
}
optional bool disabled = 5;
}
message Column {
string name = 1;
MetricType metric_type = 2;
ValueType value_type = 3;
string name_override = 4;
}
enum MetricType {
METRIC_UNSPECIFIED = 0;
METRIC_LABEL = 1;
METRIC_GAUGE = 2;
METRIC_CUMULATIVE = 3;
}
enum ValueType {
VALUE_UNSPECIFIED = 0;
VALUE_BOOL = 1;
VALUE_INT64 = 2;
VALUE_STRING = 3;
VALUE_DOUBLE = 4;
}