diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 483fb63..d139d01 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v0.7.0 diff --git a/.gitmodules b/.gitmodules index 6d987bc..96d18f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ -[submodule "tools/hypertrace/agent-config"] - path = tools/hypertrace/agent-config - url = git@github.com:hypertrace/agent-config.git +[submodule "tools/env-vars-generator/protobuf"] + path = tools/env-vars-generator/protobuf + url = https://github.com/protocolbuffers/protobuf.git +[submodule "tools/go-generator/cmd/generator/_protobuf"] + path = tools/go-generator/cmd/generator/_protobuf + url = https://github.com/protocolbuffers/protobuf.git diff --git a/ENV_VARS.md b/ENV_VARS.md index dc4efc0..6d12305 100644 --- a/ENV_VARS.md +++ b/ENV_VARS.md @@ -58,4 +58,27 @@ Agents can be configured using environment variables: | TA_METRICS_CONFIG_LOGGING_ENABLED | Set this flag to print metrics in logs | | TA_METRICS_CONFIG_LOGGING_FREQUENCY | Set the frequency at which metrics should be printed. Examples are '1s', '2m', '3h'. Default value is 30m | | TA_ENVIRONMENT | Represents the environment name of agent | -| TA_AGENT_TOKEN | Represents the agent token to be used by the agent | +| TA_SERVICE_NAME | From HT config | +| TA_REPORTING_ENDPOINT | Represents the endpoint for reporting the traces For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans For OTLP reporter type use http://api.traceable.ai:4317 | +| TA_REPORTING_SECURE | When `true`, connects to endpoints over TLS. | +| TA_REPORTING_TOKEN | User specific token to access Traceable API | +| TA_REPORTING_CERT_FILE | Certificate file containing the CA to verify the server's certificate. This is for private certificates. If this is set then `secure` above should also be set to `true`. | +| TA_REPORTING_METRIC_ENDPOINT | Represents the endpoint for reporting the metrics. For OTLP metric reporter type use http://api.traceable.ai:4317 | +| TA_REPORTING_ENABLE_GRPC_LOADBALANCING | When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing | +| TA_REPORTING_AGENT_TOKEN | Represents the agent token to be used by the agent | +| TA_DATA_CAPTURE_HTTP_HEADERS_REQUEST | When `false` it disables the capture for the request in a client/request operation | +| TA_DATA_CAPTURE_HTTP_HEADERS_RESPONSE | When `false` it disables the capture for the response in a client/request operation | +| TA_DATA_CAPTURE_HTTP_BODY_REQUEST | When `false` it disables the capture for the request in a client/request operation | +| TA_DATA_CAPTURE_HTTP_BODY_RESPONSE | When `false` it disables the capture for the response in a client/request operation | +| TA_DATA_CAPTURE_RPC_METADATA_REQUEST | When `false` it disables the capture for the request in a client/request operation | +| TA_DATA_CAPTURE_RPC_METADATA_RESPONSE | When `false` it disables the capture for the response in a client/request operation | +| TA_DATA_CAPTURE_RPC_BODY_REQUEST | When `false` it disables the capture for the request in a client/request operation | +| TA_DATA_CAPTURE_RPC_BODY_RESPONSE | When `false` it disables the capture for the response in a client/request operation | +| TA_DATA_CAPTURE_BODY_MAX_SIZE_BYTES | Is the maximum size of captured body in bytes. Default should be 131_072 (128 KiB). | +| TA_DATA_CAPTURE_BODY_MAX_PROCESSING_SIZE_BYTES | Is maximum size of body being processed by filters in bytes. Default should be 1_048_576 (1MB). For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes` in memory and pass that through the filter. For compressed and GRPC bodies, if the size of the body is larger than this, we ignore it entirely, otherwise we decompress/decode the body and then pass it to the filter. | +| TA_DATA_CAPTURE_ALLOWED_CONTENT_TYPES | Array of allowed content type substrings to record default should be json, x-www-form-urlencoded ex: ["json"] will record any request bodies that have a content-type header that includes "json". The values should be separated by `,`. | +| TA_PROPAGATION_FORMATS | List the supported propagation formats e.g. `TA_PROPAGATION_FORMATS="B3,TRACECONTEXT"`. | +| TA_ENABLED | When `false`, disables the agent | +| TA_TELEMETRY_STARTUP_SPAN_ENABLED | When `true`, an internal span is created and exported when the agent is initialized and started. It's useful to denote when the application the agent is in started. | +| TA_TELEMETRY_METRICS_ENABLED | Whether to capture metrics or not. The metrics will be otel go metrics. See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric | +| TA_GOAGENT_USE_CUSTOM_BSP | Use the custom batch_span_processor adapted from the one in opentelemetry go and supports some additional metrics | diff --git a/Makefile b/Makefile index c3ad036..f191d55 100644 --- a/Makefile +++ b/Makefile @@ -15,21 +15,22 @@ generate-proto: OUT_DIR="$(PWD)/gen/go" \ OPT_MODULE="github.com/Traceableai/agent-config/gen/go" \ ENV_PREFIX="TA_" \ - $(MAKE) -C ./tools/hypertrace/agent-config/tools/go-generator + $(MAKE) -C ./tools/go-generator @echo "Tidy generated modules." + @find $(PWD)/gen/go \( -name vendor -o -name '[._].*' -o -name node_modules \) -prune -o -name go.mod -print | sed 's:/go.mod::' | xargs -I {} bash -c 'cd {}; go mod tidy -go=1.22' @# Run gen/go load sanity tests cd $(PWD)/gen/go && go test ./... generate-env-vars: ## Generates the ENV_VARS.md with all environment variables. - docker build -t hypertrace/agent-config/env-vars-generator tools/hypertrace/agent-config/tools/env-vars-generator + docker build -t tools/env-vars-generator tools/env-vars-generator touch $(PWD)/ENV_VARS.md # makes sure this is created as a file and not as a directory docker run \ -v $(PWD)/ENV_VARS.md:/usr/local/ENV_VARS.md \ -v $(PWD)/proto/ai/traceable/agent/config/v1/config.proto:/usr/local/config.proto \ - hypertrace/agent-config/env-vars-generator \ + tools/env-vars-generator \ -o "/usr/local/ENV_VARS.md" -p "TA_" \ /usr/local/config.proto diff --git a/buf.yaml b/buf.yaml index 5d06e27..7f62f31 100644 --- a/buf.yaml +++ b/buf.yaml @@ -5,6 +5,9 @@ build: lint: use: - DEFAULT + except: + - ENUM_ZERO_VALUE_SUFFIX + - ENUM_VALUE_PREFIX breaking: use: - PACKAGE diff --git a/gen/go/proto/v1/config.proto b/gen/go/proto/v1/config.proto index 55ba793..ab936ce 100644 --- a/gen/go/proto/v1/config.proto +++ b/gen/go/proto/v1/config.proto @@ -20,6 +20,65 @@ message AgentConfig { MetricsConfig metrics_config = 9; // represents the environment name of agent google.protobuf.StringValue environment = 10; + + // From HT config + google.protobuf.StringValue service_name = 11; + + // reporting holds the reporting settings for the agent + Reporting reporting = 12; + + // data_capture describes the data being captured by instrumentation + DataCapture data_capture = 13; + + // propagation_formats list the supported propagation formats + repeated PropagationFormat propagation_formats = 14; + + // when `false`, disables the agent + google.protobuf.BoolValue enabled = 15; + + // resource_attributes map define the static list of resources which is configured on the tracer + map resource_attributes = 16; + + // telemetry + Telemetry telemetry = 17; + + // Goagent specific config + GoAgent goagent = 18; + +} + +// Reporting covers the options related to the mechanics for sending data to the +// tracing server o collector. +message Reporting { + // endpoint represents the endpoint for reporting the traces + // For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans + // For OTLP reporter type use http://api.traceable.ai:4317 + google.protobuf.StringValue endpoint = 1; + + // when `true`, connects to endpoints over TLS. + google.protobuf.BoolValue secure = 2; + + // user specific token to access Traceable API + google.protobuf.StringValue token = 3; + + // reporter type for traces. + TraceReporterType trace_reporter_type = 5; + + // Certificate file containing the CA to verify the server's certificate. + // This is for private certificates. + // If this is set then `secure` above should also be set to `true`. + google.protobuf.StringValue cert_file = 6; + + // metric_endpoint represents the endpoint for reporting the metrics. + // For OTLP metric reporter type use http://api.traceable.ai:4317 + google.protobuf.StringValue metric_endpoint = 7; + + // reporter type for metrics. + MetricReporterType metric_reporter_type = 8; + + // When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing + google.protobuf.BoolValue enable_grpc_loadbalancing = 9; + // represents the agent token to be used by the agent google.protobuf.StringValue agent_token = 11; } @@ -106,6 +165,7 @@ message SamplingConfig { message Javaagent { // set this flag to export certificates configured in JKS to libtraceable for making HTTPS connection to TPA. google.protobuf.BoolValue import_jks_certs = 1; + repeated google.protobuf.StringValue filter_jar_paths = 2; } enum LogMode { @@ -200,3 +260,120 @@ message EdgeDecisionServiceConfig { // specify regexes which will be matched with http.url attribute to exclude spans from EdgeDecisionService evaluation. repeated google.protobuf.StringValue exclude_path_regexes = 5; } + +// Message describes what message should be considered for certain DataCapture option +message Message { + // when `false` it disables the capture for the request in a client/request operation + google.protobuf.BoolValue request = 1; + + // when `false` it disables the capture for the response in a client/request operation + google.protobuf.BoolValue response = 2; +} + +// DataCapture describes the elements to be captured by the agent instrumentation +message DataCapture { + // http_headers enables/disables the capture of the request/response headers in HTTP + Message http_headers = 1; + + // http_body enables/disables the capture of the request/response body in HTTP + Message http_body = 2; + + // rpc_metadata enables/disables the capture of the request/response metadata in RPC + Message rpc_metadata = 3; + + // rpc_body enables/disables the capture of the request/response body in RPC + Message rpc_body = 4; + + // body_max_size_bytes is the maximum size of captured body in bytes. + // Default should be 131_072 (128 KiB). + google.protobuf.Int32Value body_max_size_bytes = 5; + + // body_max_processing_size_bytes is maximum size of body being processed by filters in bytes. + // Default should be 1_048_576 (1MB). + // + // For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes` + // in memory and pass that through the filter. + // For compressed and GRPC bodies, if the size of the body is larger than this, we ignore + // it entirely, otherwise we decompress/decode the body and then pass it to the filter. + google.protobuf.Int32Value body_max_processing_size_bytes = 6; + + // Array of allowed content type substrings to record + // default should be json, x-www-form-urlencoded + // ex: ["json"] will record any request bodies that have a content-type header that includes "json" + repeated google.protobuf.StringValue allowed_content_types = 10; +} + +// PropagationFormat represents the propagation formats supported by agents +enum PropagationFormat { + // B3 propagation format, agents should support both multi and single value formats + // see https://github.com/openzipkin/b3-propagation + B3 = 0; + + // W3C Propagation format + // see https://www.w3.org/TR/trace-context/ + TRACECONTEXT = 1; +} + +// TraceReporterType represents the reporting format for trace data. +enum TraceReporterType { + + // Default to none. Agent will use it's default reporting type + UNSPECIFIED = 0; + + // Zipkin protobuf reporting format. + // see https://github.com/openzipkin/zipkin-api + ZIPKIN = 1; + + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + OTLP = 2; + + // Logging reporting format + LOGGING = 3; + + // Disable trace reporting + NONE = 4; + + // OTLP over http + OTLP_HTTP = 5; +} + +// MetricReporterType represents the reporting format for metric data. +enum MetricReporterType { + + // Default to none. Agent will use it's default reporting type + METRIC_REPORTER_TYPE_UNSPECIFIED = 0; + + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + METRIC_REPORTER_TYPE_OTLP = 1; + + // Prometheus exposition format. + // see https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md + METRIC_REPORTER_TYPE_PROMETHEUS = 2; + + // Logging reporting format + METRIC_REPORTER_TYPE_LOGGING = 3; + + // Disable metric reporting + METRIC_REPORTER_TYPE_NONE = 4; +} + +// GoAgent has the configs specific to goagent +message GoAgent { + // use the custom batch_span_processor adapted from the one in opentelemetry go + // and supports some additional metrics + google.protobuf.BoolValue use_custom_bsp = 1; +} + +// Telemetry has config for agent telemetry: traces and metrics on agent's +// performance and events. +message Telemetry { + // when `true`, an internal span is created and exported when the agent is initialized and started. + // It's useful to denote when the application the agent is in started. + google.protobuf.BoolValue startup_span_enabled = 1; + + // Whether to capture metrics or not. The metrics will be otel go metrics. + // See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric + google.protobuf.BoolValue metrics_enabled = 2; +} diff --git a/gen/go/v1/config.pb.go b/gen/go/v1/config.pb.go index bf85058..4d37627 100644 --- a/gen/go/v1/config.pb.go +++ b/gen/go/v1/config.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.28.1 // protoc (unknown) // source: ai/traceable/agent/config/v1/config.proto @@ -186,18 +186,199 @@ func (SpanType) EnumDescriptor() ([]byte, []int) { return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{2} } +// PropagationFormat represents the propagation formats supported by agents +type PropagationFormat int32 + +const ( + // B3 propagation format, agents should support both multi and single value formats + // see https://github.com/openzipkin/b3-propagation + PropagationFormat_B3 PropagationFormat = 0 + // W3C Propagation format + // see https://www.w3.org/TR/trace-context/ + PropagationFormat_TRACECONTEXT PropagationFormat = 1 +) + +// Enum value maps for PropagationFormat. +var ( + PropagationFormat_name = map[int32]string{ + 0: "B3", + 1: "TRACECONTEXT", + } + PropagationFormat_value = map[string]int32{ + "B3": 0, + "TRACECONTEXT": 1, + } +) + +func (x PropagationFormat) Enum() *PropagationFormat { + p := new(PropagationFormat) + *p = x + return p +} + +func (x PropagationFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PropagationFormat) Descriptor() protoreflect.EnumDescriptor { + return file_ai_traceable_agent_config_v1_config_proto_enumTypes[3].Descriptor() +} + +func (PropagationFormat) Type() protoreflect.EnumType { + return &file_ai_traceable_agent_config_v1_config_proto_enumTypes[3] +} + +func (x PropagationFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PropagationFormat.Descriptor instead. +func (PropagationFormat) EnumDescriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{3} +} + +// TraceReporterType represents the reporting format for trace data. +type TraceReporterType int32 + +const ( + // Default to none. Agent will use it's default reporting type + TraceReporterType_UNSPECIFIED TraceReporterType = 0 + // Zipkin protobuf reporting format. + // see https://github.com/openzipkin/zipkin-api + TraceReporterType_ZIPKIN TraceReporterType = 1 + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + TraceReporterType_OTLP TraceReporterType = 2 + // Logging reporting format + TraceReporterType_LOGGING TraceReporterType = 3 + // Disable trace reporting + TraceReporterType_NONE TraceReporterType = 4 + // OTLP over http + TraceReporterType_OTLP_HTTP TraceReporterType = 5 +) + +// Enum value maps for TraceReporterType. +var ( + TraceReporterType_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "ZIPKIN", + 2: "OTLP", + 3: "LOGGING", + 4: "NONE", + 5: "OTLP_HTTP", + } + TraceReporterType_value = map[string]int32{ + "UNSPECIFIED": 0, + "ZIPKIN": 1, + "OTLP": 2, + "LOGGING": 3, + "NONE": 4, + "OTLP_HTTP": 5, + } +) + +func (x TraceReporterType) Enum() *TraceReporterType { + p := new(TraceReporterType) + *p = x + return p +} + +func (x TraceReporterType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TraceReporterType) Descriptor() protoreflect.EnumDescriptor { + return file_ai_traceable_agent_config_v1_config_proto_enumTypes[4].Descriptor() +} + +func (TraceReporterType) Type() protoreflect.EnumType { + return &file_ai_traceable_agent_config_v1_config_proto_enumTypes[4] +} + +func (x TraceReporterType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TraceReporterType.Descriptor instead. +func (TraceReporterType) EnumDescriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{4} +} + +// MetricReporterType represents the reporting format for metric data. +type MetricReporterType int32 + +const ( + // Default to none. Agent will use it's default reporting type + MetricReporterType_METRIC_REPORTER_TYPE_UNSPECIFIED MetricReporterType = 0 + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + MetricReporterType_METRIC_REPORTER_TYPE_OTLP MetricReporterType = 1 + // Prometheus exposition format. + // see https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md + MetricReporterType_METRIC_REPORTER_TYPE_PROMETHEUS MetricReporterType = 2 + // Logging reporting format + MetricReporterType_METRIC_REPORTER_TYPE_LOGGING MetricReporterType = 3 + // Disable metric reporting + MetricReporterType_METRIC_REPORTER_TYPE_NONE MetricReporterType = 4 +) + +// Enum value maps for MetricReporterType. +var ( + MetricReporterType_name = map[int32]string{ + 0: "METRIC_REPORTER_TYPE_UNSPECIFIED", + 1: "METRIC_REPORTER_TYPE_OTLP", + 2: "METRIC_REPORTER_TYPE_PROMETHEUS", + 3: "METRIC_REPORTER_TYPE_LOGGING", + 4: "METRIC_REPORTER_TYPE_NONE", + } + MetricReporterType_value = map[string]int32{ + "METRIC_REPORTER_TYPE_UNSPECIFIED": 0, + "METRIC_REPORTER_TYPE_OTLP": 1, + "METRIC_REPORTER_TYPE_PROMETHEUS": 2, + "METRIC_REPORTER_TYPE_LOGGING": 3, + "METRIC_REPORTER_TYPE_NONE": 4, + } +) + +func (x MetricReporterType) Enum() *MetricReporterType { + p := new(MetricReporterType) + *p = x + return p +} + +func (x MetricReporterType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetricReporterType) Descriptor() protoreflect.EnumDescriptor { + return file_ai_traceable_agent_config_v1_config_proto_enumTypes[5].Descriptor() +} + +func (MetricReporterType) Type() protoreflect.EnumType { + return &file_ai_traceable_agent_config_v1_config_proto_enumTypes[5] +} + +func (x MetricReporterType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MetricReporterType.Descriptor instead. +func (MetricReporterType) EnumDescriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{5} +} + type AgentConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. + // Deprecated: Do not use. Opa *Opa `protobuf:"bytes,1,opt,name=opa,proto3" json:"opa,omitempty"` BlockingConfig *BlockingConfig `protobuf:"bytes,2,opt,name=blocking_config,json=blockingConfig,proto3" json:"blocking_config,omitempty"` - // Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. + // Deprecated: Do not use. DebugLog *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=debug_log,json=debugLog,proto3" json:"debug_log,omitempty"` RemoteConfig *RemoteConfig `protobuf:"bytes,4,opt,name=remote_config,json=remoteConfig,proto3" json:"remote_config,omitempty"` - // Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. + // Deprecated: Do not use. ApiDiscovery *ApiDiscoveryConfig `protobuf:"bytes,5,opt,name=api_discovery,json=apiDiscovery,proto3" json:"api_discovery,omitempty"` Sampling *SamplingConfig `protobuf:"bytes,6,opt,name=sampling,proto3" json:"sampling,omitempty"` // javaagent has the configs specific to javaagent @@ -206,8 +387,22 @@ type AgentConfig struct { MetricsConfig *MetricsConfig `protobuf:"bytes,9,opt,name=metrics_config,json=metricsConfig,proto3" json:"metrics_config,omitempty"` // represents the environment name of agent Environment *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"` - // represents the agent token to be used by the agent - AgentToken *wrapperspb.StringValue `protobuf:"bytes,11,opt,name=agent_token,json=agentToken,proto3" json:"agent_token,omitempty"` + // From HT config + ServiceName *wrapperspb.StringValue `protobuf:"bytes,11,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + // reporting holds the reporting settings for the agent + Reporting *Reporting `protobuf:"bytes,12,opt,name=reporting,proto3" json:"reporting,omitempty"` + // data_capture describes the data being captured by instrumentation + DataCapture *DataCapture `protobuf:"bytes,13,opt,name=data_capture,json=dataCapture,proto3" json:"data_capture,omitempty"` + // propagation_formats list the supported propagation formats + PropagationFormats []PropagationFormat `protobuf:"varint,14,rep,packed,name=propagation_formats,json=propagationFormats,proto3,enum=ai.traceable.agent.config.v1.PropagationFormat" json:"propagation_formats,omitempty"` + // when `false`, disables the agent + Enabled *wrapperspb.BoolValue `protobuf:"bytes,15,opt,name=enabled,proto3" json:"enabled,omitempty"` + // resource_attributes map define the static list of resources which is configured on the tracer + ResourceAttributes map[string]string `protobuf:"bytes,16,rep,name=resource_attributes,json=resourceAttributes,proto3" json:"resource_attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // telemetry + Telemetry *Telemetry `protobuf:"bytes,17,opt,name=telemetry,proto3" json:"telemetry,omitempty"` + // Goagent specific config + Goagent *GoAgent `protobuf:"bytes,18,opt,name=goagent,proto3" json:"goagent,omitempty"` } func (x *AgentConfig) Reset() { @@ -242,7 +437,7 @@ func (*AgentConfig) Descriptor() ([]byte, []int) { return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{0} } -// Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. +// Deprecated: Do not use. func (x *AgentConfig) GetOpa() *Opa { if x != nil { return x.Opa @@ -257,7 +452,7 @@ func (x *AgentConfig) GetBlockingConfig() *BlockingConfig { return nil } -// Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. +// Deprecated: Do not use. func (x *AgentConfig) GetDebugLog() *wrapperspb.BoolValue { if x != nil { return x.DebugLog @@ -272,7 +467,7 @@ func (x *AgentConfig) GetRemoteConfig() *RemoteConfig { return nil } -// Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. +// Deprecated: Do not use. func (x *AgentConfig) GetApiDiscovery() *ApiDiscoveryConfig { if x != nil { return x.ApiDiscovery @@ -315,7 +510,183 @@ func (x *AgentConfig) GetEnvironment() *wrapperspb.StringValue { return nil } -func (x *AgentConfig) GetAgentToken() *wrapperspb.StringValue { +func (x *AgentConfig) GetServiceName() *wrapperspb.StringValue { + if x != nil { + return x.ServiceName + } + return nil +} + +func (x *AgentConfig) GetReporting() *Reporting { + if x != nil { + return x.Reporting + } + return nil +} + +func (x *AgentConfig) GetDataCapture() *DataCapture { + if x != nil { + return x.DataCapture + } + return nil +} + +func (x *AgentConfig) GetPropagationFormats() []PropagationFormat { + if x != nil { + return x.PropagationFormats + } + return nil +} + +func (x *AgentConfig) GetEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +func (x *AgentConfig) GetResourceAttributes() map[string]string { + if x != nil { + return x.ResourceAttributes + } + return nil +} + +func (x *AgentConfig) GetTelemetry() *Telemetry { + if x != nil { + return x.Telemetry + } + return nil +} + +func (x *AgentConfig) GetGoagent() *GoAgent { + if x != nil { + return x.Goagent + } + return nil +} + +// Reporting covers the options related to the mechanics for sending data to the +// tracing server o collector. +type Reporting struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // endpoint represents the endpoint for reporting the traces + // For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans + // For OTLP reporter type use http://api.traceable.ai:4317 + Endpoint *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + // when `true`, connects to endpoints over TLS. + Secure *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=secure,proto3" json:"secure,omitempty"` + // user specific token to access Traceable API + Token *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + // reporter type for traces. + TraceReporterType TraceReporterType `protobuf:"varint,5,opt,name=trace_reporter_type,json=traceReporterType,proto3,enum=ai.traceable.agent.config.v1.TraceReporterType" json:"trace_reporter_type,omitempty"` + // Certificate file containing the CA to verify the server's certificate. + // This is for private certificates. + // If this is set then `secure` above should also be set to `true`. + CertFile *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"` + // metric_endpoint represents the endpoint for reporting the metrics. + // For OTLP metric reporter type use http://api.traceable.ai:4317 + MetricEndpoint *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=metric_endpoint,json=metricEndpoint,proto3" json:"metric_endpoint,omitempty"` + // reporter type for metrics. + MetricReporterType MetricReporterType `protobuf:"varint,8,opt,name=metric_reporter_type,json=metricReporterType,proto3,enum=ai.traceable.agent.config.v1.MetricReporterType" json:"metric_reporter_type,omitempty"` + // When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing + EnableGrpcLoadbalancing *wrapperspb.BoolValue `protobuf:"bytes,9,opt,name=enable_grpc_loadbalancing,json=enableGrpcLoadbalancing,proto3" json:"enable_grpc_loadbalancing,omitempty"` + // represents the agent token to be used by the agent + AgentToken *wrapperspb.StringValue `protobuf:"bytes,11,opt,name=agent_token,json=agentToken,proto3" json:"agent_token,omitempty"` +} + +func (x *Reporting) Reset() { + *x = Reporting{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reporting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reporting) ProtoMessage() {} + +func (x *Reporting) ProtoReflect() protoreflect.Message { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reporting.ProtoReflect.Descriptor instead. +func (*Reporting) Descriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{1} +} + +func (x *Reporting) GetEndpoint() *wrapperspb.StringValue { + if x != nil { + return x.Endpoint + } + return nil +} + +func (x *Reporting) GetSecure() *wrapperspb.BoolValue { + if x != nil { + return x.Secure + } + return nil +} + +func (x *Reporting) GetToken() *wrapperspb.StringValue { + if x != nil { + return x.Token + } + return nil +} + +func (x *Reporting) GetTraceReporterType() TraceReporterType { + if x != nil { + return x.TraceReporterType + } + return TraceReporterType_UNSPECIFIED +} + +func (x *Reporting) GetCertFile() *wrapperspb.StringValue { + if x != nil { + return x.CertFile + } + return nil +} + +func (x *Reporting) GetMetricEndpoint() *wrapperspb.StringValue { + if x != nil { + return x.MetricEndpoint + } + return nil +} + +func (x *Reporting) GetMetricReporterType() MetricReporterType { + if x != nil { + return x.MetricReporterType + } + return MetricReporterType_METRIC_REPORTER_TYPE_UNSPECIFIED +} + +func (x *Reporting) GetEnableGrpcLoadbalancing() *wrapperspb.BoolValue { + if x != nil { + return x.EnableGrpcLoadbalancing + } + return nil +} + +func (x *Reporting) GetAgentToken() *wrapperspb.StringValue { if x != nil { return x.AgentToken } @@ -345,7 +716,7 @@ type Opa struct { func (x *Opa) Reset() { *x = Opa{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[1] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -358,7 +729,7 @@ func (x *Opa) String() string { func (*Opa) ProtoMessage() {} func (x *Opa) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[1] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -371,7 +742,7 @@ func (x *Opa) ProtoReflect() protoreflect.Message { // Deprecated: Use Opa.ProtoReflect.Descriptor instead. func (*Opa) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{1} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{2} } func (x *Opa) GetEnabled() *wrapperspb.BoolValue { @@ -418,14 +789,14 @@ type BlockingConfig struct { Enabled *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // debug_log has moved to top level // - // Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. + // Deprecated: Do not use. DebugLog *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=debug_log,json=debugLog,proto3" json:"debug_log,omitempty"` Modsecurity *ModsecurityConfig `protobuf:"bytes,3,opt,name=modsecurity,proto3" json:"modsecurity,omitempty"` EvaluateBody *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=evaluate_body,json=evaluateBody,proto3" json:"evaluate_body,omitempty"` RegionBlocking *RegionBlockingConfig `protobuf:"bytes,5,opt,name=region_blocking,json=regionBlocking,proto3" json:"region_blocking,omitempty"` // remote_config has moved to top level // - // Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. + // Deprecated: Do not use. RemoteConfig *RemoteConfig `protobuf:"bytes,6,opt,name=remote_config,json=remoteConfig,proto3" json:"remote_config,omitempty"` // when `true`, blocking evaluation will be skipped for internal requests i.e. requests coming // from private IPs @@ -443,7 +814,7 @@ type BlockingConfig struct { func (x *BlockingConfig) Reset() { *x = BlockingConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[2] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +827,7 @@ func (x *BlockingConfig) String() string { func (*BlockingConfig) ProtoMessage() {} func (x *BlockingConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[2] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +840,7 @@ func (x *BlockingConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockingConfig.ProtoReflect.Descriptor instead. func (*BlockingConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{2} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{3} } func (x *BlockingConfig) GetEnabled() *wrapperspb.BoolValue { @@ -479,7 +850,7 @@ func (x *BlockingConfig) GetEnabled() *wrapperspb.BoolValue { return nil } -// Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. +// Deprecated: Do not use. func (x *BlockingConfig) GetDebugLog() *wrapperspb.BoolValue { if x != nil { return x.DebugLog @@ -508,7 +879,7 @@ func (x *BlockingConfig) GetRegionBlocking() *RegionBlockingConfig { return nil } -// Deprecated: Marked as deprecated in ai/traceable/agent/config/v1/config.proto. +// Deprecated: Do not use. func (x *BlockingConfig) GetRemoteConfig() *RemoteConfig { if x != nil { return x.RemoteConfig @@ -562,7 +933,7 @@ type ModsecurityConfig struct { func (x *ModsecurityConfig) Reset() { *x = ModsecurityConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[3] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -575,7 +946,7 @@ func (x *ModsecurityConfig) String() string { func (*ModsecurityConfig) ProtoMessage() {} func (x *ModsecurityConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[3] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -588,7 +959,7 @@ func (x *ModsecurityConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ModsecurityConfig.ProtoReflect.Descriptor instead. func (*ModsecurityConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{3} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{4} } func (x *ModsecurityConfig) GetEnabled() *wrapperspb.BoolValue { @@ -609,7 +980,7 @@ type RegionBlockingConfig struct { func (x *RegionBlockingConfig) Reset() { *x = RegionBlockingConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[4] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -622,7 +993,7 @@ func (x *RegionBlockingConfig) String() string { func (*RegionBlockingConfig) ProtoMessage() {} func (x *RegionBlockingConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[4] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -635,7 +1006,7 @@ func (x *RegionBlockingConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionBlockingConfig.ProtoReflect.Descriptor instead. func (*RegionBlockingConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{4} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{5} } func (x *RegionBlockingConfig) GetEnabled() *wrapperspb.BoolValue { @@ -667,7 +1038,7 @@ type RemoteConfig struct { func (x *RemoteConfig) Reset() { *x = RemoteConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[5] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -680,7 +1051,7 @@ func (x *RemoteConfig) String() string { func (*RemoteConfig) ProtoMessage() {} func (x *RemoteConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[5] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -693,7 +1064,7 @@ func (x *RemoteConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoteConfig.ProtoReflect.Descriptor instead. func (*RemoteConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{5} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{6} } func (x *RemoteConfig) GetEnabled() *wrapperspb.BoolValue { @@ -749,7 +1120,7 @@ type ApiDiscoveryConfig struct { func (x *ApiDiscoveryConfig) Reset() { *x = ApiDiscoveryConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[6] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -762,7 +1133,7 @@ func (x *ApiDiscoveryConfig) String() string { func (*ApiDiscoveryConfig) ProtoMessage() {} func (x *ApiDiscoveryConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[6] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -775,7 +1146,7 @@ func (x *ApiDiscoveryConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ApiDiscoveryConfig.ProtoReflect.Descriptor instead. func (*ApiDiscoveryConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{6} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{7} } func (x *ApiDiscoveryConfig) GetEnabled() *wrapperspb.BoolValue { @@ -797,7 +1168,7 @@ type SamplingConfig struct { func (x *SamplingConfig) Reset() { *x = SamplingConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[7] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -810,7 +1181,7 @@ func (x *SamplingConfig) String() string { func (*SamplingConfig) ProtoMessage() {} func (x *SamplingConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[7] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -823,7 +1194,7 @@ func (x *SamplingConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SamplingConfig.ProtoReflect.Descriptor instead. func (*SamplingConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{7} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{8} } func (x *SamplingConfig) GetEnabled() *wrapperspb.BoolValue { @@ -846,13 +1217,14 @@ type Javaagent struct { unknownFields protoimpl.UnknownFields // set this flag to export certificates configured in JKS to libtraceable for making HTTPS connection to TPA. - ImportJksCerts *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=import_jks_certs,json=importJksCerts,proto3" json:"import_jks_certs,omitempty"` + ImportJksCerts *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=import_jks_certs,json=importJksCerts,proto3" json:"import_jks_certs,omitempty"` + FilterJarPaths []*wrapperspb.StringValue `protobuf:"bytes,2,rep,name=filter_jar_paths,json=filterJarPaths,proto3" json:"filter_jar_paths,omitempty"` } func (x *Javaagent) Reset() { *x = Javaagent{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[8] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -865,7 +1237,7 @@ func (x *Javaagent) String() string { func (*Javaagent) ProtoMessage() {} func (x *Javaagent) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[8] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -878,7 +1250,7 @@ func (x *Javaagent) ProtoReflect() protoreflect.Message { // Deprecated: Use Javaagent.ProtoReflect.Descriptor instead. func (*Javaagent) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{8} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{9} } func (x *Javaagent) GetImportJksCerts() *wrapperspb.BoolValue { @@ -888,6 +1260,13 @@ func (x *Javaagent) GetImportJksCerts() *wrapperspb.BoolValue { return nil } +func (x *Javaagent) GetFilterJarPaths() []*wrapperspb.StringValue { + if x != nil { + return x.FilterJarPaths + } + return nil +} + type LogConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -902,7 +1281,7 @@ type LogConfig struct { func (x *LogConfig) Reset() { *x = LogConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[9] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -915,7 +1294,7 @@ func (x *LogConfig) String() string { func (*LogConfig) ProtoMessage() {} func (x *LogConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[9] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -928,7 +1307,7 @@ func (x *LogConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use LogConfig.ProtoReflect.Descriptor instead. func (*LogConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{9} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{10} } func (x *LogConfig) GetLogMode() LogMode { @@ -968,7 +1347,7 @@ type LogFileConfig struct { func (x *LogFileConfig) Reset() { *x = LogFileConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[10] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -981,7 +1360,7 @@ func (x *LogFileConfig) String() string { func (*LogFileConfig) ProtoMessage() {} func (x *LogFileConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[10] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -994,7 +1373,7 @@ func (x *LogFileConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use LogFileConfig.ProtoReflect.Descriptor instead. func (*LogFileConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{10} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{11} } func (x *LogFileConfig) GetMaxFiles() *wrapperspb.Int32Value { @@ -1032,7 +1411,7 @@ type MetricsLogConfig struct { func (x *MetricsLogConfig) Reset() { *x = MetricsLogConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[11] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1045,7 +1424,7 @@ func (x *MetricsLogConfig) String() string { func (*MetricsLogConfig) ProtoMessage() {} func (x *MetricsLogConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[11] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1058,7 +1437,7 @@ func (x *MetricsLogConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use MetricsLogConfig.ProtoReflect.Descriptor instead. func (*MetricsLogConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{11} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{12} } func (x *MetricsLogConfig) GetEnabled() *wrapperspb.BoolValue { @@ -1091,7 +1470,7 @@ type EndpointMetricsConfig struct { func (x *EndpointMetricsConfig) Reset() { *x = EndpointMetricsConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[12] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1104,7 +1483,7 @@ func (x *EndpointMetricsConfig) String() string { func (*EndpointMetricsConfig) ProtoMessage() {} func (x *EndpointMetricsConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[12] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1117,7 +1496,7 @@ func (x *EndpointMetricsConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use EndpointMetricsConfig.ProtoReflect.Descriptor instead. func (*EndpointMetricsConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{12} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{13} } func (x *EndpointMetricsConfig) GetEnabled() *wrapperspb.BoolValue { @@ -1157,7 +1536,7 @@ type MetricsConfig struct { func (x *MetricsConfig) Reset() { *x = MetricsConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[13] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1170,7 +1549,7 @@ func (x *MetricsConfig) String() string { func (*MetricsConfig) ProtoMessage() {} func (x *MetricsConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[13] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1183,7 +1562,7 @@ func (x *MetricsConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use MetricsConfig.ProtoReflect.Descriptor instead. func (*MetricsConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{13} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{14} } func (x *MetricsConfig) GetEnabled() *wrapperspb.BoolValue { @@ -1229,7 +1608,7 @@ type RateLimitConfig struct { func (x *RateLimitConfig) Reset() { *x = RateLimitConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[14] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1242,7 +1621,7 @@ func (x *RateLimitConfig) String() string { func (*RateLimitConfig) ProtoMessage() {} func (x *RateLimitConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[14] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1255,7 +1634,7 @@ func (x *RateLimitConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitConfig.ProtoReflect.Descriptor instead. func (*RateLimitConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{14} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{15} } func (x *RateLimitConfig) GetEnabled() *wrapperspb.BoolValue { @@ -1320,7 +1699,7 @@ type EdgeDecisionServiceConfig struct { func (x *EdgeDecisionServiceConfig) Reset() { *x = EdgeDecisionServiceConfig{} if protoimpl.UnsafeEnabled { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[15] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1333,7 +1712,7 @@ func (x *EdgeDecisionServiceConfig) String() string { func (*EdgeDecisionServiceConfig) ProtoMessage() {} func (x *EdgeDecisionServiceConfig) ProtoReflect() protoreflect.Message { - mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[15] + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1346,7 +1725,7 @@ func (x *EdgeDecisionServiceConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use EdgeDecisionServiceConfig.ProtoReflect.Descriptor instead. func (*EdgeDecisionServiceConfig) Descriptor() ([]byte, []int) { - return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{15} + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{16} } func (x *EdgeDecisionServiceConfig) GetEnabled() *wrapperspb.BoolValue { @@ -1384,6 +1763,287 @@ func (x *EdgeDecisionServiceConfig) GetExcludePathRegexes() []*wrapperspb.String return nil } +// Message describes what message should be considered for certain DataCapture option +type Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // when `false` it disables the capture for the request in a client/request operation + Request *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // when `false` it disables the capture for the response in a client/request operation + Response *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{17} +} + +func (x *Message) GetRequest() *wrapperspb.BoolValue { + if x != nil { + return x.Request + } + return nil +} + +func (x *Message) GetResponse() *wrapperspb.BoolValue { + if x != nil { + return x.Response + } + return nil +} + +// DataCapture describes the elements to be captured by the agent instrumentation +type DataCapture struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // http_headers enables/disables the capture of the request/response headers in HTTP + HttpHeaders *Message `protobuf:"bytes,1,opt,name=http_headers,json=httpHeaders,proto3" json:"http_headers,omitempty"` + // http_body enables/disables the capture of the request/response body in HTTP + HttpBody *Message `protobuf:"bytes,2,opt,name=http_body,json=httpBody,proto3" json:"http_body,omitempty"` + // rpc_metadata enables/disables the capture of the request/response metadata in RPC + RpcMetadata *Message `protobuf:"bytes,3,opt,name=rpc_metadata,json=rpcMetadata,proto3" json:"rpc_metadata,omitempty"` + // rpc_body enables/disables the capture of the request/response body in RPC + RpcBody *Message `protobuf:"bytes,4,opt,name=rpc_body,json=rpcBody,proto3" json:"rpc_body,omitempty"` + // body_max_size_bytes is the maximum size of captured body in bytes. + // Default should be 131_072 (128 KiB). + BodyMaxSizeBytes *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=body_max_size_bytes,json=bodyMaxSizeBytes,proto3" json:"body_max_size_bytes,omitempty"` + // body_max_processing_size_bytes is maximum size of body being processed by filters in bytes. + // Default should be 1_048_576 (1MB). + // + // For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes` + // in memory and pass that through the filter. + // For compressed and GRPC bodies, if the size of the body is larger than this, we ignore + // it entirely, otherwise we decompress/decode the body and then pass it to the filter. + BodyMaxProcessingSizeBytes *wrapperspb.Int32Value `protobuf:"bytes,6,opt,name=body_max_processing_size_bytes,json=bodyMaxProcessingSizeBytes,proto3" json:"body_max_processing_size_bytes,omitempty"` + // Array of allowed content type substrings to record + // default should be json, x-www-form-urlencoded + // ex: ["json"] will record any request bodies that have a content-type header that includes "json" + AllowedContentTypes []*wrapperspb.StringValue `protobuf:"bytes,10,rep,name=allowed_content_types,json=allowedContentTypes,proto3" json:"allowed_content_types,omitempty"` +} + +func (x *DataCapture) Reset() { + *x = DataCapture{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataCapture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataCapture) ProtoMessage() {} + +func (x *DataCapture) ProtoReflect() protoreflect.Message { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataCapture.ProtoReflect.Descriptor instead. +func (*DataCapture) Descriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{18} +} + +func (x *DataCapture) GetHttpHeaders() *Message { + if x != nil { + return x.HttpHeaders + } + return nil +} + +func (x *DataCapture) GetHttpBody() *Message { + if x != nil { + return x.HttpBody + } + return nil +} + +func (x *DataCapture) GetRpcMetadata() *Message { + if x != nil { + return x.RpcMetadata + } + return nil +} + +func (x *DataCapture) GetRpcBody() *Message { + if x != nil { + return x.RpcBody + } + return nil +} + +func (x *DataCapture) GetBodyMaxSizeBytes() *wrapperspb.Int32Value { + if x != nil { + return x.BodyMaxSizeBytes + } + return nil +} + +func (x *DataCapture) GetBodyMaxProcessingSizeBytes() *wrapperspb.Int32Value { + if x != nil { + return x.BodyMaxProcessingSizeBytes + } + return nil +} + +func (x *DataCapture) GetAllowedContentTypes() []*wrapperspb.StringValue { + if x != nil { + return x.AllowedContentTypes + } + return nil +} + +// GoAgent has the configs specific to goagent +type GoAgent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // use the custom batch_span_processor adapted from the one in opentelemetry go + // and supports some additional metrics + UseCustomBsp *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=use_custom_bsp,json=useCustomBsp,proto3" json:"use_custom_bsp,omitempty"` +} + +func (x *GoAgent) Reset() { + *x = GoAgent{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoAgent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoAgent) ProtoMessage() {} + +func (x *GoAgent) ProtoReflect() protoreflect.Message { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GoAgent.ProtoReflect.Descriptor instead. +func (*GoAgent) Descriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{19} +} + +func (x *GoAgent) GetUseCustomBsp() *wrapperspb.BoolValue { + if x != nil { + return x.UseCustomBsp + } + return nil +} + +// Telemetry has config for agent telemetry: traces and metrics on agent's +// performance and events. +type Telemetry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // when `true`, an internal span is created and exported when the agent is initialized and started. + // It's useful to denote when the application the agent is in started. + StartupSpanEnabled *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=startup_span_enabled,json=startupSpanEnabled,proto3" json:"startup_span_enabled,omitempty"` + // Whether to capture metrics or not. The metrics will be otel go metrics. + // See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric + MetricsEnabled *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=metrics_enabled,json=metricsEnabled,proto3" json:"metrics_enabled,omitempty"` +} + +func (x *Telemetry) Reset() { + *x = Telemetry{} + if protoimpl.UnsafeEnabled { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Telemetry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Telemetry) ProtoMessage() {} + +func (x *Telemetry) ProtoReflect() protoreflect.Message { + mi := &file_ai_traceable_agent_config_v1_config_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Telemetry.ProtoReflect.Descriptor instead. +func (*Telemetry) Descriptor() ([]byte, []int) { + return file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP(), []int{20} +} + +func (x *Telemetry) GetStartupSpanEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.StartupSpanEnabled + } + return nil +} + +func (x *Telemetry) GetMetricsEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.MetricsEnabled + } + return nil +} + var File_ai_traceable_agent_config_v1_config_proto protoreflect.FileDescriptor var file_ai_traceable_agent_config_v1_config_proto_rawDesc = []byte{ @@ -1393,7 +2053,7 @@ var file_ai_traceable_agent_config_v1_config_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x06, 0x0a, 0x0b, 0x41, 0x67, + 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x0b, 0x0a, 0x0b, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x03, 0x6f, 0x70, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, @@ -1440,7 +2100,87 @@ var file_ai_traceable_agent_config_v1_config_proto_rawDesc = []byte{ 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x61, 0x67, + 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x4c, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x61, 0x70, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x61, 0x70, 0x74, + 0x75, 0x72, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x60, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2f, 0x2e, + 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x12, + 0x70, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x72, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, + 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x09, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x09, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x07, 0x67, 0x6f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, + 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x67, 0x6f, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x1a, 0x45, 0x0a, 0x17, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8b, 0x05, 0x0a, 0x09, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x06, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x5f, 0x0a, 0x13, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x11, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x09, + 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x63, + 0x65, 0x72, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x62, + 0x0a, 0x14, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x61, + 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x56, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x70, + 0x63, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x47, 0x72, 0x70, 0x63, 0x4c, 0x6f, 0x61, + 0x64, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x3d, 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, @@ -1573,155 +2313,238 @@ var file_ai_traceable_agent_config_v1_config_proto_rawDesc = []byte{ 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x22, 0x51, 0x0a, 0x09, 0x4a, 0x61, 0x76, 0x61, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, - 0x44, 0x0a, 0x10, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6b, 0x73, 0x5f, 0x63, 0x65, - 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6b, 0x73, - 0x43, 0x65, 0x72, 0x74, 0x73, 0x22, 0xda, 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x40, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x69, 0x67, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x4a, 0x61, 0x76, 0x61, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x12, 0x44, 0x0a, 0x10, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6b, 0x73, 0x5f, 0x63, + 0x65, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6b, + 0x73, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x5f, 0x6a, 0x61, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x4a, 0x61, 0x72, 0x50, 0x61, 0x74, 0x68, 0x73, 0x22, 0xda, + 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x40, 0x0a, 0x08, + 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, + 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, + 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x43, + 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x46, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x6c, 0x6f, - 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x43, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, - 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x46, 0x0a, 0x08, 0x6c, 0x6f, - 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, - 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x46, - 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, - 0x6c, 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3f, - 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x39, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x0d, + 0x4c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, + 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, + 0x61, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x6d, 0x61, 0x78, + 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, + 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4c, + 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, + 0x0a, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xd9, 0x01, 0x0a, 0x15, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x6d, 0x61, + 0x78, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, + 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x48, 0x0a, 0x07, + 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x22, 0xed, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5c, + 0x0a, 0x0f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x48, 0x0a, 0x07, + 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x22, 0xc0, 0x03, 0x0a, 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x45, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x67, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x50, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, + 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x43, 0x0a, 0x0e, 0x72, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x54, + 0x0a, 0x17, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x15, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x08, 0x73, 0x70, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0xe7, 0x02, 0x0a, 0x19, 0x45, 0x64, + 0x67, 0x65, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x38, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x4d, 0x73, 0x12, 0x4e, 0x0a, 0x14, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x67, 0x65, + 0x78, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x14, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x12, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x67, 0x65, + 0x78, 0x65, 0x73, 0x22, 0x77, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa6, 0x04, 0x0a, + 0x0b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x12, 0x48, 0x0a, 0x0c, + 0x68, 0x74, 0x74, 0x70, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, + 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x08, 0x68, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x48, 0x0a, 0x0c, 0x72, 0x70, + 0x63, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x72, + 0x70, 0x63, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x4a, 0x0a, 0x13, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x6d, + 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x10, 0x62, 0x6f, 0x64, 0x79, 0x4d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x1e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x1a, 0x62, 0x6f, 0x64, 0x79, 0x4d, 0x61, 0x78, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x79, 0x22, 0xd9, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, - 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4c, 0x6f, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x22, 0xed, 0x01, - 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5c, 0x0a, 0x0f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, - 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, - 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x0e, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x48, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, - 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4c, 0x6f, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x22, 0xc0, 0x03, - 0x0a, 0x0f, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, - 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x50, - 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x4b, 0x0a, 0x07, 0x47, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x12, 0x40, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, + 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, + 0x73, 0x70, 0x22, 0x9e, 0x01, 0x0a, 0x09, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x12, 0x4c, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x5f, 0x73, 0x70, 0x61, 0x6e, + 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x6d, 0x61, 0x78, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x43, 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x54, 0x0a, 0x17, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x15, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x73, - 0x70, 0x61, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x61, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, - 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x73, 0x70, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x22, 0xe7, 0x02, 0x0a, 0x19, 0x45, 0x64, 0x67, 0x65, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3a, - 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4d, 0x73, 0x12, 0x4e, 0x0a, 0x14, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x52, 0x65, 0x67, 0x65, 0x78, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x14, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, - 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x52, 0x65, 0x67, 0x65, 0x78, 0x65, 0x73, 0x2a, 0x5e, 0x0a, 0x07, 0x4c, 0x6f, - 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, - 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, - 0x54, 0x44, 0x4f, 0x55, 0x54, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, - 0x4f, 0x44, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x03, 0x2a, 0xa4, 0x01, 0x0a, 0x08, 0x4c, - 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, - 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, - 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x03, - 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, - 0x52, 0x4e, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, - 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, 0x47, - 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, - 0x06, 0x2a, 0x6e, 0x0a, 0x08, 0x53, 0x70, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, - 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x50, 0x41, 0x4e, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, 0x01, 0x12, - 0x17, 0x0a, 0x13, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x52, - 0x45, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x50, 0x41, 0x4e, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, - 0x03, 0x42, 0x4b, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x54, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x61, 0x69, 0x2f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, - 0x76, 0x31, 0xaa, 0x02, 0x19, 0x54, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x75, 0x70, 0x53, 0x70, 0x61, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x43, + 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x2a, 0x5e, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x14, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x5f, + 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4c, + 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x44, 0x4f, 0x55, 0x54, 0x10, 0x02, + 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x46, 0x49, 0x4c, + 0x45, 0x10, 0x03, 0x2a, 0xa4, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, + 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x01, + 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, + 0x42, 0x55, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, + 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x4f, 0x47, + 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x04, 0x12, 0x13, 0x0a, + 0x0f, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, + 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x06, 0x2a, 0x6e, 0x0a, 0x08, 0x53, 0x70, + 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, + 0x4f, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x50, 0x41, 0x4e, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x52, 0x45, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, + 0x02, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, + 0x55, 0x4c, 0x4c, 0x5f, 0x53, 0x50, 0x41, 0x4e, 0x10, 0x03, 0x2a, 0x2d, 0x0a, 0x11, 0x50, 0x72, + 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x06, 0x0a, 0x02, 0x42, 0x33, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x52, 0x41, 0x43, 0x45, + 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x2a, 0x60, 0x0a, 0x11, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, + 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x5a, 0x49, 0x50, 0x4b, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4f, + 0x54, 0x4c, 0x50, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x4c, 0x4f, 0x47, 0x47, 0x49, 0x4e, 0x47, + 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, + 0x4f, 0x54, 0x4c, 0x50, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x10, 0x05, 0x2a, 0xbf, 0x01, 0x0a, 0x12, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x52, 0x45, 0x50, + 0x4f, 0x52, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, 0x54, 0x52, + 0x49, 0x43, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4f, 0x54, 0x4c, 0x50, 0x10, 0x01, 0x12, 0x23, 0x0a, 0x1f, 0x4d, 0x45, 0x54, 0x52, 0x49, + 0x43, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x50, 0x52, 0x4f, 0x4d, 0x45, 0x54, 0x48, 0x45, 0x55, 0x53, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, + 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x52, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x47, 0x47, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x1d, + 0x0a, 0x19, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x45, + 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x04, 0x42, 0x4b, 0x5a, + 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x61, 0x62, 0x6c, 0x65, 0x61, 0x69, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0xaa, 0x02, + 0x19, 0x54, 0x72, 0x61, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1736,103 +2559,141 @@ func file_ai_traceable_agent_config_v1_config_proto_rawDescGZIP() []byte { return file_ai_traceable_agent_config_v1_config_proto_rawDescData } -var file_ai_traceable_agent_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_ai_traceable_agent_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_ai_traceable_agent_config_v1_config_proto_goTypes = []any{ +var file_ai_traceable_agent_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_ai_traceable_agent_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_ai_traceable_agent_config_v1_config_proto_goTypes = []interface{}{ (LogMode)(0), // 0: ai.traceable.agent.config.v1.LogMode (LogLevel)(0), // 1: ai.traceable.agent.config.v1.LogLevel (SpanType)(0), // 2: ai.traceable.agent.config.v1.SpanType - (*AgentConfig)(nil), // 3: ai.traceable.agent.config.v1.AgentConfig - (*Opa)(nil), // 4: ai.traceable.agent.config.v1.Opa - (*BlockingConfig)(nil), // 5: ai.traceable.agent.config.v1.BlockingConfig - (*ModsecurityConfig)(nil), // 6: ai.traceable.agent.config.v1.ModsecurityConfig - (*RegionBlockingConfig)(nil), // 7: ai.traceable.agent.config.v1.RegionBlockingConfig - (*RemoteConfig)(nil), // 8: ai.traceable.agent.config.v1.RemoteConfig - (*ApiDiscoveryConfig)(nil), // 9: ai.traceable.agent.config.v1.ApiDiscoveryConfig - (*SamplingConfig)(nil), // 10: ai.traceable.agent.config.v1.SamplingConfig - (*Javaagent)(nil), // 11: ai.traceable.agent.config.v1.Javaagent - (*LogConfig)(nil), // 12: ai.traceable.agent.config.v1.LogConfig - (*LogFileConfig)(nil), // 13: ai.traceable.agent.config.v1.LogFileConfig - (*MetricsLogConfig)(nil), // 14: ai.traceable.agent.config.v1.MetricsLogConfig - (*EndpointMetricsConfig)(nil), // 15: ai.traceable.agent.config.v1.EndpointMetricsConfig - (*MetricsConfig)(nil), // 16: ai.traceable.agent.config.v1.MetricsConfig - (*RateLimitConfig)(nil), // 17: ai.traceable.agent.config.v1.RateLimitConfig - (*EdgeDecisionServiceConfig)(nil), // 18: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig - (*wrapperspb.BoolValue)(nil), // 19: google.protobuf.BoolValue - (*wrapperspb.StringValue)(nil), // 20: google.protobuf.StringValue - (*wrapperspb.Int32Value)(nil), // 21: google.protobuf.Int32Value - (*wrapperspb.Int64Value)(nil), // 22: google.protobuf.Int64Value + (PropagationFormat)(0), // 3: ai.traceable.agent.config.v1.PropagationFormat + (TraceReporterType)(0), // 4: ai.traceable.agent.config.v1.TraceReporterType + (MetricReporterType)(0), // 5: ai.traceable.agent.config.v1.MetricReporterType + (*AgentConfig)(nil), // 6: ai.traceable.agent.config.v1.AgentConfig + (*Reporting)(nil), // 7: ai.traceable.agent.config.v1.Reporting + (*Opa)(nil), // 8: ai.traceable.agent.config.v1.Opa + (*BlockingConfig)(nil), // 9: ai.traceable.agent.config.v1.BlockingConfig + (*ModsecurityConfig)(nil), // 10: ai.traceable.agent.config.v1.ModsecurityConfig + (*RegionBlockingConfig)(nil), // 11: ai.traceable.agent.config.v1.RegionBlockingConfig + (*RemoteConfig)(nil), // 12: ai.traceable.agent.config.v1.RemoteConfig + (*ApiDiscoveryConfig)(nil), // 13: ai.traceable.agent.config.v1.ApiDiscoveryConfig + (*SamplingConfig)(nil), // 14: ai.traceable.agent.config.v1.SamplingConfig + (*Javaagent)(nil), // 15: ai.traceable.agent.config.v1.Javaagent + (*LogConfig)(nil), // 16: ai.traceable.agent.config.v1.LogConfig + (*LogFileConfig)(nil), // 17: ai.traceable.agent.config.v1.LogFileConfig + (*MetricsLogConfig)(nil), // 18: ai.traceable.agent.config.v1.MetricsLogConfig + (*EndpointMetricsConfig)(nil), // 19: ai.traceable.agent.config.v1.EndpointMetricsConfig + (*MetricsConfig)(nil), // 20: ai.traceable.agent.config.v1.MetricsConfig + (*RateLimitConfig)(nil), // 21: ai.traceable.agent.config.v1.RateLimitConfig + (*EdgeDecisionServiceConfig)(nil), // 22: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig + (*Message)(nil), // 23: ai.traceable.agent.config.v1.Message + (*DataCapture)(nil), // 24: ai.traceable.agent.config.v1.DataCapture + (*GoAgent)(nil), // 25: ai.traceable.agent.config.v1.GoAgent + (*Telemetry)(nil), // 26: ai.traceable.agent.config.v1.Telemetry + nil, // 27: ai.traceable.agent.config.v1.AgentConfig.ResourceAttributesEntry + (*wrapperspb.BoolValue)(nil), // 28: google.protobuf.BoolValue + (*wrapperspb.StringValue)(nil), // 29: google.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 30: google.protobuf.Int32Value + (*wrapperspb.Int64Value)(nil), // 31: google.protobuf.Int64Value } var file_ai_traceable_agent_config_v1_config_proto_depIdxs = []int32{ - 4, // 0: ai.traceable.agent.config.v1.AgentConfig.opa:type_name -> ai.traceable.agent.config.v1.Opa - 5, // 1: ai.traceable.agent.config.v1.AgentConfig.blocking_config:type_name -> ai.traceable.agent.config.v1.BlockingConfig - 19, // 2: ai.traceable.agent.config.v1.AgentConfig.debug_log:type_name -> google.protobuf.BoolValue - 8, // 3: ai.traceable.agent.config.v1.AgentConfig.remote_config:type_name -> ai.traceable.agent.config.v1.RemoteConfig - 9, // 4: ai.traceable.agent.config.v1.AgentConfig.api_discovery:type_name -> ai.traceable.agent.config.v1.ApiDiscoveryConfig - 10, // 5: ai.traceable.agent.config.v1.AgentConfig.sampling:type_name -> ai.traceable.agent.config.v1.SamplingConfig - 11, // 6: ai.traceable.agent.config.v1.AgentConfig.javaagent:type_name -> ai.traceable.agent.config.v1.Javaagent - 12, // 7: ai.traceable.agent.config.v1.AgentConfig.logging:type_name -> ai.traceable.agent.config.v1.LogConfig - 16, // 8: ai.traceable.agent.config.v1.AgentConfig.metrics_config:type_name -> ai.traceable.agent.config.v1.MetricsConfig - 20, // 9: ai.traceable.agent.config.v1.AgentConfig.environment:type_name -> google.protobuf.StringValue - 20, // 10: ai.traceable.agent.config.v1.AgentConfig.agent_token:type_name -> google.protobuf.StringValue - 19, // 11: ai.traceable.agent.config.v1.Opa.enabled:type_name -> google.protobuf.BoolValue - 20, // 12: ai.traceable.agent.config.v1.Opa.endpoint:type_name -> google.protobuf.StringValue - 21, // 13: ai.traceable.agent.config.v1.Opa.poll_period_seconds:type_name -> google.protobuf.Int32Value - 20, // 14: ai.traceable.agent.config.v1.Opa.cert_file:type_name -> google.protobuf.StringValue - 19, // 15: ai.traceable.agent.config.v1.Opa.use_secure_connection:type_name -> google.protobuf.BoolValue - 19, // 16: ai.traceable.agent.config.v1.BlockingConfig.enabled:type_name -> google.protobuf.BoolValue - 19, // 17: ai.traceable.agent.config.v1.BlockingConfig.debug_log:type_name -> google.protobuf.BoolValue - 6, // 18: ai.traceable.agent.config.v1.BlockingConfig.modsecurity:type_name -> ai.traceable.agent.config.v1.ModsecurityConfig - 19, // 19: ai.traceable.agent.config.v1.BlockingConfig.evaluate_body:type_name -> google.protobuf.BoolValue - 7, // 20: ai.traceable.agent.config.v1.BlockingConfig.region_blocking:type_name -> ai.traceable.agent.config.v1.RegionBlockingConfig - 8, // 21: ai.traceable.agent.config.v1.BlockingConfig.remote_config:type_name -> ai.traceable.agent.config.v1.RemoteConfig - 19, // 22: ai.traceable.agent.config.v1.BlockingConfig.skip_internal_request:type_name -> google.protobuf.BoolValue - 21, // 23: ai.traceable.agent.config.v1.BlockingConfig.response_status_code:type_name -> google.protobuf.Int32Value - 21, // 24: ai.traceable.agent.config.v1.BlockingConfig.max_recursion_depth:type_name -> google.protobuf.Int32Value - 20, // 25: ai.traceable.agent.config.v1.BlockingConfig.response_message:type_name -> google.protobuf.StringValue - 18, // 26: ai.traceable.agent.config.v1.BlockingConfig.edge_decision_service:type_name -> ai.traceable.agent.config.v1.EdgeDecisionServiceConfig - 19, // 27: ai.traceable.agent.config.v1.ModsecurityConfig.enabled:type_name -> google.protobuf.BoolValue - 19, // 28: ai.traceable.agent.config.v1.RegionBlockingConfig.enabled:type_name -> google.protobuf.BoolValue - 19, // 29: ai.traceable.agent.config.v1.RemoteConfig.enabled:type_name -> google.protobuf.BoolValue - 20, // 30: ai.traceable.agent.config.v1.RemoteConfig.endpoint:type_name -> google.protobuf.StringValue - 21, // 31: ai.traceable.agent.config.v1.RemoteConfig.poll_period_seconds:type_name -> google.protobuf.Int32Value - 20, // 32: ai.traceable.agent.config.v1.RemoteConfig.cert_file:type_name -> google.protobuf.StringValue - 21, // 33: ai.traceable.agent.config.v1.RemoteConfig.grpc_max_call_recv_msg_size:type_name -> google.protobuf.Int32Value - 19, // 34: ai.traceable.agent.config.v1.RemoteConfig.use_secure_connection:type_name -> google.protobuf.BoolValue - 19, // 35: ai.traceable.agent.config.v1.ApiDiscoveryConfig.enabled:type_name -> google.protobuf.BoolValue - 19, // 36: ai.traceable.agent.config.v1.SamplingConfig.enabled:type_name -> google.protobuf.BoolValue - 17, // 37: ai.traceable.agent.config.v1.SamplingConfig.default_rate_limit_config:type_name -> ai.traceable.agent.config.v1.RateLimitConfig - 19, // 38: ai.traceable.agent.config.v1.Javaagent.import_jks_certs:type_name -> google.protobuf.BoolValue - 0, // 39: ai.traceable.agent.config.v1.LogConfig.log_mode:type_name -> ai.traceable.agent.config.v1.LogMode - 1, // 40: ai.traceable.agent.config.v1.LogConfig.log_level:type_name -> ai.traceable.agent.config.v1.LogLevel - 13, // 41: ai.traceable.agent.config.v1.LogConfig.log_file:type_name -> ai.traceable.agent.config.v1.LogFileConfig - 21, // 42: ai.traceable.agent.config.v1.LogFileConfig.max_files:type_name -> google.protobuf.Int32Value - 21, // 43: ai.traceable.agent.config.v1.LogFileConfig.max_file_size:type_name -> google.protobuf.Int32Value - 20, // 44: ai.traceable.agent.config.v1.LogFileConfig.file_path:type_name -> google.protobuf.StringValue - 19, // 45: ai.traceable.agent.config.v1.MetricsLogConfig.enabled:type_name -> google.protobuf.BoolValue - 20, // 46: ai.traceable.agent.config.v1.MetricsLogConfig.frequency:type_name -> google.protobuf.StringValue - 19, // 47: ai.traceable.agent.config.v1.EndpointMetricsConfig.enabled:type_name -> google.protobuf.BoolValue - 21, // 48: ai.traceable.agent.config.v1.EndpointMetricsConfig.max_endpoints:type_name -> google.protobuf.Int32Value - 14, // 49: ai.traceable.agent.config.v1.EndpointMetricsConfig.logging:type_name -> ai.traceable.agent.config.v1.MetricsLogConfig - 19, // 50: ai.traceable.agent.config.v1.MetricsConfig.enabled:type_name -> google.protobuf.BoolValue - 15, // 51: ai.traceable.agent.config.v1.MetricsConfig.endpoint_config:type_name -> ai.traceable.agent.config.v1.EndpointMetricsConfig - 14, // 52: ai.traceable.agent.config.v1.MetricsConfig.logging:type_name -> ai.traceable.agent.config.v1.MetricsLogConfig - 19, // 53: ai.traceable.agent.config.v1.RateLimitConfig.enabled:type_name -> google.protobuf.BoolValue - 22, // 54: ai.traceable.agent.config.v1.RateLimitConfig.max_count_global:type_name -> google.protobuf.Int64Value - 22, // 55: ai.traceable.agent.config.v1.RateLimitConfig.max_count_per_endpoint:type_name -> google.protobuf.Int64Value - 20, // 56: ai.traceable.agent.config.v1.RateLimitConfig.refresh_period:type_name -> google.protobuf.StringValue - 20, // 57: ai.traceable.agent.config.v1.RateLimitConfig.value_expiration_period:type_name -> google.protobuf.StringValue - 2, // 58: ai.traceable.agent.config.v1.RateLimitConfig.span_type:type_name -> ai.traceable.agent.config.v1.SpanType - 19, // 59: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.enabled:type_name -> google.protobuf.BoolValue - 20, // 60: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.endpoint:type_name -> google.protobuf.StringValue - 21, // 61: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.timeout_ms:type_name -> google.protobuf.Int32Value - 20, // 62: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.include_path_regexes:type_name -> google.protobuf.StringValue - 20, // 63: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.exclude_path_regexes:type_name -> google.protobuf.StringValue - 64, // [64:64] is the sub-list for method output_type - 64, // [64:64] is the sub-list for method input_type - 64, // [64:64] is the sub-list for extension type_name - 64, // [64:64] is the sub-list for extension extendee - 0, // [0:64] is the sub-list for field type_name + 8, // 0: ai.traceable.agent.config.v1.AgentConfig.opa:type_name -> ai.traceable.agent.config.v1.Opa + 9, // 1: ai.traceable.agent.config.v1.AgentConfig.blocking_config:type_name -> ai.traceable.agent.config.v1.BlockingConfig + 28, // 2: ai.traceable.agent.config.v1.AgentConfig.debug_log:type_name -> google.protobuf.BoolValue + 12, // 3: ai.traceable.agent.config.v1.AgentConfig.remote_config:type_name -> ai.traceable.agent.config.v1.RemoteConfig + 13, // 4: ai.traceable.agent.config.v1.AgentConfig.api_discovery:type_name -> ai.traceable.agent.config.v1.ApiDiscoveryConfig + 14, // 5: ai.traceable.agent.config.v1.AgentConfig.sampling:type_name -> ai.traceable.agent.config.v1.SamplingConfig + 15, // 6: ai.traceable.agent.config.v1.AgentConfig.javaagent:type_name -> ai.traceable.agent.config.v1.Javaagent + 16, // 7: ai.traceable.agent.config.v1.AgentConfig.logging:type_name -> ai.traceable.agent.config.v1.LogConfig + 20, // 8: ai.traceable.agent.config.v1.AgentConfig.metrics_config:type_name -> ai.traceable.agent.config.v1.MetricsConfig + 29, // 9: ai.traceable.agent.config.v1.AgentConfig.environment:type_name -> google.protobuf.StringValue + 29, // 10: ai.traceable.agent.config.v1.AgentConfig.service_name:type_name -> google.protobuf.StringValue + 7, // 11: ai.traceable.agent.config.v1.AgentConfig.reporting:type_name -> ai.traceable.agent.config.v1.Reporting + 24, // 12: ai.traceable.agent.config.v1.AgentConfig.data_capture:type_name -> ai.traceable.agent.config.v1.DataCapture + 3, // 13: ai.traceable.agent.config.v1.AgentConfig.propagation_formats:type_name -> ai.traceable.agent.config.v1.PropagationFormat + 28, // 14: ai.traceable.agent.config.v1.AgentConfig.enabled:type_name -> google.protobuf.BoolValue + 27, // 15: ai.traceable.agent.config.v1.AgentConfig.resource_attributes:type_name -> ai.traceable.agent.config.v1.AgentConfig.ResourceAttributesEntry + 26, // 16: ai.traceable.agent.config.v1.AgentConfig.telemetry:type_name -> ai.traceable.agent.config.v1.Telemetry + 25, // 17: ai.traceable.agent.config.v1.AgentConfig.goagent:type_name -> ai.traceable.agent.config.v1.GoAgent + 29, // 18: ai.traceable.agent.config.v1.Reporting.endpoint:type_name -> google.protobuf.StringValue + 28, // 19: ai.traceable.agent.config.v1.Reporting.secure:type_name -> google.protobuf.BoolValue + 29, // 20: ai.traceable.agent.config.v1.Reporting.token:type_name -> google.protobuf.StringValue + 4, // 21: ai.traceable.agent.config.v1.Reporting.trace_reporter_type:type_name -> ai.traceable.agent.config.v1.TraceReporterType + 29, // 22: ai.traceable.agent.config.v1.Reporting.cert_file:type_name -> google.protobuf.StringValue + 29, // 23: ai.traceable.agent.config.v1.Reporting.metric_endpoint:type_name -> google.protobuf.StringValue + 5, // 24: ai.traceable.agent.config.v1.Reporting.metric_reporter_type:type_name -> ai.traceable.agent.config.v1.MetricReporterType + 28, // 25: ai.traceable.agent.config.v1.Reporting.enable_grpc_loadbalancing:type_name -> google.protobuf.BoolValue + 29, // 26: ai.traceable.agent.config.v1.Reporting.agent_token:type_name -> google.protobuf.StringValue + 28, // 27: ai.traceable.agent.config.v1.Opa.enabled:type_name -> google.protobuf.BoolValue + 29, // 28: ai.traceable.agent.config.v1.Opa.endpoint:type_name -> google.protobuf.StringValue + 30, // 29: ai.traceable.agent.config.v1.Opa.poll_period_seconds:type_name -> google.protobuf.Int32Value + 29, // 30: ai.traceable.agent.config.v1.Opa.cert_file:type_name -> google.protobuf.StringValue + 28, // 31: ai.traceable.agent.config.v1.Opa.use_secure_connection:type_name -> google.protobuf.BoolValue + 28, // 32: ai.traceable.agent.config.v1.BlockingConfig.enabled:type_name -> google.protobuf.BoolValue + 28, // 33: ai.traceable.agent.config.v1.BlockingConfig.debug_log:type_name -> google.protobuf.BoolValue + 10, // 34: ai.traceable.agent.config.v1.BlockingConfig.modsecurity:type_name -> ai.traceable.agent.config.v1.ModsecurityConfig + 28, // 35: ai.traceable.agent.config.v1.BlockingConfig.evaluate_body:type_name -> google.protobuf.BoolValue + 11, // 36: ai.traceable.agent.config.v1.BlockingConfig.region_blocking:type_name -> ai.traceable.agent.config.v1.RegionBlockingConfig + 12, // 37: ai.traceable.agent.config.v1.BlockingConfig.remote_config:type_name -> ai.traceable.agent.config.v1.RemoteConfig + 28, // 38: ai.traceable.agent.config.v1.BlockingConfig.skip_internal_request:type_name -> google.protobuf.BoolValue + 30, // 39: ai.traceable.agent.config.v1.BlockingConfig.response_status_code:type_name -> google.protobuf.Int32Value + 30, // 40: ai.traceable.agent.config.v1.BlockingConfig.max_recursion_depth:type_name -> google.protobuf.Int32Value + 29, // 41: ai.traceable.agent.config.v1.BlockingConfig.response_message:type_name -> google.protobuf.StringValue + 22, // 42: ai.traceable.agent.config.v1.BlockingConfig.edge_decision_service:type_name -> ai.traceable.agent.config.v1.EdgeDecisionServiceConfig + 28, // 43: ai.traceable.agent.config.v1.ModsecurityConfig.enabled:type_name -> google.protobuf.BoolValue + 28, // 44: ai.traceable.agent.config.v1.RegionBlockingConfig.enabled:type_name -> google.protobuf.BoolValue + 28, // 45: ai.traceable.agent.config.v1.RemoteConfig.enabled:type_name -> google.protobuf.BoolValue + 29, // 46: ai.traceable.agent.config.v1.RemoteConfig.endpoint:type_name -> google.protobuf.StringValue + 30, // 47: ai.traceable.agent.config.v1.RemoteConfig.poll_period_seconds:type_name -> google.protobuf.Int32Value + 29, // 48: ai.traceable.agent.config.v1.RemoteConfig.cert_file:type_name -> google.protobuf.StringValue + 30, // 49: ai.traceable.agent.config.v1.RemoteConfig.grpc_max_call_recv_msg_size:type_name -> google.protobuf.Int32Value + 28, // 50: ai.traceable.agent.config.v1.RemoteConfig.use_secure_connection:type_name -> google.protobuf.BoolValue + 28, // 51: ai.traceable.agent.config.v1.ApiDiscoveryConfig.enabled:type_name -> google.protobuf.BoolValue + 28, // 52: ai.traceable.agent.config.v1.SamplingConfig.enabled:type_name -> google.protobuf.BoolValue + 21, // 53: ai.traceable.agent.config.v1.SamplingConfig.default_rate_limit_config:type_name -> ai.traceable.agent.config.v1.RateLimitConfig + 28, // 54: ai.traceable.agent.config.v1.Javaagent.import_jks_certs:type_name -> google.protobuf.BoolValue + 29, // 55: ai.traceable.agent.config.v1.Javaagent.filter_jar_paths:type_name -> google.protobuf.StringValue + 0, // 56: ai.traceable.agent.config.v1.LogConfig.log_mode:type_name -> ai.traceable.agent.config.v1.LogMode + 1, // 57: ai.traceable.agent.config.v1.LogConfig.log_level:type_name -> ai.traceable.agent.config.v1.LogLevel + 17, // 58: ai.traceable.agent.config.v1.LogConfig.log_file:type_name -> ai.traceable.agent.config.v1.LogFileConfig + 30, // 59: ai.traceable.agent.config.v1.LogFileConfig.max_files:type_name -> google.protobuf.Int32Value + 30, // 60: ai.traceable.agent.config.v1.LogFileConfig.max_file_size:type_name -> google.protobuf.Int32Value + 29, // 61: ai.traceable.agent.config.v1.LogFileConfig.file_path:type_name -> google.protobuf.StringValue + 28, // 62: ai.traceable.agent.config.v1.MetricsLogConfig.enabled:type_name -> google.protobuf.BoolValue + 29, // 63: ai.traceable.agent.config.v1.MetricsLogConfig.frequency:type_name -> google.protobuf.StringValue + 28, // 64: ai.traceable.agent.config.v1.EndpointMetricsConfig.enabled:type_name -> google.protobuf.BoolValue + 30, // 65: ai.traceable.agent.config.v1.EndpointMetricsConfig.max_endpoints:type_name -> google.protobuf.Int32Value + 18, // 66: ai.traceable.agent.config.v1.EndpointMetricsConfig.logging:type_name -> ai.traceable.agent.config.v1.MetricsLogConfig + 28, // 67: ai.traceable.agent.config.v1.MetricsConfig.enabled:type_name -> google.protobuf.BoolValue + 19, // 68: ai.traceable.agent.config.v1.MetricsConfig.endpoint_config:type_name -> ai.traceable.agent.config.v1.EndpointMetricsConfig + 18, // 69: ai.traceable.agent.config.v1.MetricsConfig.logging:type_name -> ai.traceable.agent.config.v1.MetricsLogConfig + 28, // 70: ai.traceable.agent.config.v1.RateLimitConfig.enabled:type_name -> google.protobuf.BoolValue + 31, // 71: ai.traceable.agent.config.v1.RateLimitConfig.max_count_global:type_name -> google.protobuf.Int64Value + 31, // 72: ai.traceable.agent.config.v1.RateLimitConfig.max_count_per_endpoint:type_name -> google.protobuf.Int64Value + 29, // 73: ai.traceable.agent.config.v1.RateLimitConfig.refresh_period:type_name -> google.protobuf.StringValue + 29, // 74: ai.traceable.agent.config.v1.RateLimitConfig.value_expiration_period:type_name -> google.protobuf.StringValue + 2, // 75: ai.traceable.agent.config.v1.RateLimitConfig.span_type:type_name -> ai.traceable.agent.config.v1.SpanType + 28, // 76: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.enabled:type_name -> google.protobuf.BoolValue + 29, // 77: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.endpoint:type_name -> google.protobuf.StringValue + 30, // 78: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.timeout_ms:type_name -> google.protobuf.Int32Value + 29, // 79: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.include_path_regexes:type_name -> google.protobuf.StringValue + 29, // 80: ai.traceable.agent.config.v1.EdgeDecisionServiceConfig.exclude_path_regexes:type_name -> google.protobuf.StringValue + 28, // 81: ai.traceable.agent.config.v1.Message.request:type_name -> google.protobuf.BoolValue + 28, // 82: ai.traceable.agent.config.v1.Message.response:type_name -> google.protobuf.BoolValue + 23, // 83: ai.traceable.agent.config.v1.DataCapture.http_headers:type_name -> ai.traceable.agent.config.v1.Message + 23, // 84: ai.traceable.agent.config.v1.DataCapture.http_body:type_name -> ai.traceable.agent.config.v1.Message + 23, // 85: ai.traceable.agent.config.v1.DataCapture.rpc_metadata:type_name -> ai.traceable.agent.config.v1.Message + 23, // 86: ai.traceable.agent.config.v1.DataCapture.rpc_body:type_name -> ai.traceable.agent.config.v1.Message + 30, // 87: ai.traceable.agent.config.v1.DataCapture.body_max_size_bytes:type_name -> google.protobuf.Int32Value + 30, // 88: ai.traceable.agent.config.v1.DataCapture.body_max_processing_size_bytes:type_name -> google.protobuf.Int32Value + 29, // 89: ai.traceable.agent.config.v1.DataCapture.allowed_content_types:type_name -> google.protobuf.StringValue + 28, // 90: ai.traceable.agent.config.v1.GoAgent.use_custom_bsp:type_name -> google.protobuf.BoolValue + 28, // 91: ai.traceable.agent.config.v1.Telemetry.startup_span_enabled:type_name -> google.protobuf.BoolValue + 28, // 92: ai.traceable.agent.config.v1.Telemetry.metrics_enabled:type_name -> google.protobuf.BoolValue + 93, // [93:93] is the sub-list for method output_type + 93, // [93:93] is the sub-list for method input_type + 93, // [93:93] is the sub-list for extension type_name + 93, // [93:93] is the sub-list for extension extendee + 0, // [0:93] is the sub-list for field type_name } func init() { file_ai_traceable_agent_config_v1_config_proto_init() } @@ -1841,7 +2702,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_ai_traceable_agent_config_v1_config_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AgentConfig); i { case 0: return &v.state @@ -1853,7 +2714,19 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reporting); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ai_traceable_agent_config_v1_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Opa); i { case 0: return &v.state @@ -1865,7 +2738,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockingConfig); i { case 0: return &v.state @@ -1877,7 +2750,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ModsecurityConfig); i { case 0: return &v.state @@ -1889,7 +2762,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegionBlockingConfig); i { case 0: return &v.state @@ -1901,7 +2774,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoteConfig); i { case 0: return &v.state @@ -1913,7 +2786,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ApiDiscoveryConfig); i { case 0: return &v.state @@ -1925,7 +2798,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SamplingConfig); i { case 0: return &v.state @@ -1937,7 +2810,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Javaagent); i { case 0: return &v.state @@ -1949,7 +2822,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogConfig); i { case 0: return &v.state @@ -1961,7 +2834,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogFileConfig); i { case 0: return &v.state @@ -1973,7 +2846,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MetricsLogConfig); i { case 0: return &v.state @@ -1985,7 +2858,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EndpointMetricsConfig); i { case 0: return &v.state @@ -1997,7 +2870,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MetricsConfig); i { case 0: return &v.state @@ -2009,7 +2882,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RateLimitConfig); i { case 0: return &v.state @@ -2021,7 +2894,7 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } - file_ai_traceable_agent_config_v1_config_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_ai_traceable_agent_config_v1_config_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EdgeDecisionServiceConfig); i { case 0: return &v.state @@ -2033,14 +2906,62 @@ func file_ai_traceable_agent_config_v1_config_proto_init() { return nil } } + file_ai_traceable_agent_config_v1_config_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ai_traceable_agent_config_v1_config_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataCapture); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ai_traceable_agent_config_v1_config_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoAgent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ai_traceable_agent_config_v1_config_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Telemetry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_ai_traceable_agent_config_v1_config_proto_rawDesc, - NumEnums: 3, - NumMessages: 16, + NumEnums: 6, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/gen/go/v1/config.pbloader.go b/gen/go/v1/config.pbloader.go index 533cd64..bec28d9 100644 --- a/gen/go/v1/config.pbloader.go +++ b/gen/go/v1/config.pbloader.go @@ -98,6 +98,173 @@ func (x *AgentConfig) loadFromEnv(prefix string, defaultValues *AgentConfig) { x.Environment = &wrappers.StringValue{Value: defaultValues.Environment.Value} } } + if val, ok := getStringEnv(prefix + "SERVICE_NAME"); ok { + x.ServiceName = &wrappers.StringValue{Value: val} + } else if x.ServiceName == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.ServiceName = new(wrappers.StringValue) + if defaultValues != nil && defaultValues.ServiceName != nil { + x.ServiceName = &wrappers.StringValue{Value: defaultValues.ServiceName.Value} + } + } + if x.Reporting == nil { + x.Reporting = new(Reporting) + } + if defaultValues == nil { + x.Reporting.loadFromEnv(prefix+"REPORTING_", nil) + } else { + x.Reporting.loadFromEnv(prefix+"REPORTING_", defaultValues.Reporting) + } + + if x.DataCapture == nil { + x.DataCapture = new(DataCapture) + } + if defaultValues == nil { + x.DataCapture.loadFromEnv(prefix+"DATA_CAPTURE_", nil) + } else { + x.DataCapture.loadFromEnv(prefix+"DATA_CAPTURE_", defaultValues.DataCapture) + } + + if rawVals, ok := getArrayStringEnv(prefix + "PROPAGATION_FORMATS"); ok { + vals := []PropagationFormat{} + for _, rawVal := range rawVals { + vals = append(vals, PropagationFormat(PropagationFormat_value[rawVal])) + } + x.PropagationFormats = vals + } else if len(x.PropagationFormats) == 0 && defaultValues != nil && len(defaultValues.PropagationFormats) > 0 { + x.PropagationFormats = defaultValues.PropagationFormats + } + + if val, ok := getBoolEnv(prefix + "ENABLED"); ok { + x.Enabled = &wrappers.BoolValue{Value: val} + } else if x.Enabled == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Enabled = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.Enabled != nil { + x.Enabled = &wrappers.BoolValue{Value: defaultValues.Enabled.Value} + } + } + if defaultValues != nil && len(defaultValues.ResourceAttributes) > 0 { + if x.ResourceAttributes == nil { + x.ResourceAttributes = make(map[string]string) + } + for k, v := range defaultValues.ResourceAttributes { + // defaults should not override existing resource attributes unless empty + if _, ok := x.ResourceAttributes[k]; !ok { + x.ResourceAttributes[k] = v + } + } + } + + if x.Telemetry == nil { + x.Telemetry = new(Telemetry) + } + if defaultValues == nil { + x.Telemetry.loadFromEnv(prefix+"TELEMETRY_", nil) + } else { + x.Telemetry.loadFromEnv(prefix+"TELEMETRY_", defaultValues.Telemetry) + } + + if x.Goagent == nil { + x.Goagent = new(GoAgent) + } + if defaultValues == nil { + x.Goagent.loadFromEnv(prefix+"GOAGENT_", nil) + } else { + x.Goagent.loadFromEnv(prefix+"GOAGENT_", defaultValues.Goagent) + } + +} + +// PutResourceAttributes sets values in the ResourceAttributes map. +func (x *AgentConfig) PutResourceAttributes(m map[string]string) { + if len(m) == 0 { + return + } + if x.ResourceAttributes == nil { + x.ResourceAttributes = make(map[string]string) + } + for k, v := range m { + x.ResourceAttributes[k] = v + } +} + +// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. +func (x *Reporting) loadFromEnv(prefix string, defaultValues *Reporting) { + if val, ok := getStringEnv(prefix + "ENDPOINT"); ok { + x.Endpoint = &wrappers.StringValue{Value: val} + } else if x.Endpoint == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Endpoint = new(wrappers.StringValue) + if defaultValues != nil && defaultValues.Endpoint != nil { + x.Endpoint = &wrappers.StringValue{Value: defaultValues.Endpoint.Value} + } + } + if val, ok := getBoolEnv(prefix + "SECURE"); ok { + x.Secure = &wrappers.BoolValue{Value: val} + } else if x.Secure == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Secure = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.Secure != nil { + x.Secure = &wrappers.BoolValue{Value: defaultValues.Secure.Value} + } + } + if val, ok := getStringEnv(prefix + "TOKEN"); ok { + x.Token = &wrappers.StringValue{Value: val} + } else if x.Token == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Token = new(wrappers.StringValue) + if defaultValues != nil && defaultValues.Token != nil { + x.Token = &wrappers.StringValue{Value: defaultValues.Token.Value} + } + } + if rawVal, ok := getStringEnv(prefix + "TRACE_REPORTER_TYPE"); ok { + x.TraceReporterType = TraceReporterType(TraceReporterType_value[rawVal]) + } else if x.TraceReporterType == TraceReporterType(0) && defaultValues != nil && defaultValues.TraceReporterType != TraceReporterType(0) { + x.TraceReporterType = defaultValues.TraceReporterType + } + + if val, ok := getStringEnv(prefix + "CERT_FILE"); ok { + x.CertFile = &wrappers.StringValue{Value: val} + } else if x.CertFile == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.CertFile = new(wrappers.StringValue) + if defaultValues != nil && defaultValues.CertFile != nil { + x.CertFile = &wrappers.StringValue{Value: defaultValues.CertFile.Value} + } + } + if val, ok := getStringEnv(prefix + "METRIC_ENDPOINT"); ok { + x.MetricEndpoint = &wrappers.StringValue{Value: val} + } else if x.MetricEndpoint == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.MetricEndpoint = new(wrappers.StringValue) + if defaultValues != nil && defaultValues.MetricEndpoint != nil { + x.MetricEndpoint = &wrappers.StringValue{Value: defaultValues.MetricEndpoint.Value} + } + } + if rawVal, ok := getStringEnv(prefix + "METRIC_REPORTER_TYPE"); ok { + x.MetricReporterType = MetricReporterType(MetricReporterType_value[rawVal]) + } else if x.MetricReporterType == MetricReporterType(0) && defaultValues != nil && defaultValues.MetricReporterType != MetricReporterType(0) { + x.MetricReporterType = defaultValues.MetricReporterType + } + + if val, ok := getBoolEnv(prefix + "ENABLE_GRPC_LOADBALANCING"); ok { + x.EnableGrpcLoadbalancing = &wrappers.BoolValue{Value: val} + } else if x.EnableGrpcLoadbalancing == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.EnableGrpcLoadbalancing = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.EnableGrpcLoadbalancing != nil { + x.EnableGrpcLoadbalancing = &wrappers.BoolValue{Value: defaultValues.EnableGrpcLoadbalancing.Value} + } + } if val, ok := getStringEnv(prefix + "AGENT_TOKEN"); ok { x.AgentToken = &wrappers.StringValue{Value: val} } else if x.AgentToken == nil { @@ -415,6 +582,14 @@ func (x *Javaagent) loadFromEnv(prefix string, defaultValues *Javaagent) { x.ImportJksCerts = &wrappers.BoolValue{Value: defaultValues.ImportJksCerts.Value} } } + if rawVals, ok := getArrayStringEnv(prefix + "FILTER_JAR_PATHS"); ok { + for _, val := range rawVals { + x.FilterJarPaths = append(x.FilterJarPaths, wrappers.String(val)) + } + } else if len(x.FilterJarPaths) == 0 && defaultValues != nil && len(defaultValues.FilterJarPaths) > 0 { + x.FilterJarPaths = defaultValues.FilterJarPaths + } + } // loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. @@ -674,3 +849,133 @@ func (x *EdgeDecisionServiceConfig) loadFromEnv(prefix string, defaultValues *Ed } } + +// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. +func (x *Message) loadFromEnv(prefix string, defaultValues *Message) { + if val, ok := getBoolEnv(prefix + "REQUEST"); ok { + x.Request = &wrappers.BoolValue{Value: val} + } else if x.Request == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Request = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.Request != nil { + x.Request = &wrappers.BoolValue{Value: defaultValues.Request.Value} + } + } + if val, ok := getBoolEnv(prefix + "RESPONSE"); ok { + x.Response = &wrappers.BoolValue{Value: val} + } else if x.Response == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.Response = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.Response != nil { + x.Response = &wrappers.BoolValue{Value: defaultValues.Response.Value} + } + } +} + +// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. +func (x *DataCapture) loadFromEnv(prefix string, defaultValues *DataCapture) { + if x.HttpHeaders == nil { + x.HttpHeaders = new(Message) + } + if defaultValues == nil { + x.HttpHeaders.loadFromEnv(prefix+"HTTP_HEADERS_", nil) + } else { + x.HttpHeaders.loadFromEnv(prefix+"HTTP_HEADERS_", defaultValues.HttpHeaders) + } + + if x.HttpBody == nil { + x.HttpBody = new(Message) + } + if defaultValues == nil { + x.HttpBody.loadFromEnv(prefix+"HTTP_BODY_", nil) + } else { + x.HttpBody.loadFromEnv(prefix+"HTTP_BODY_", defaultValues.HttpBody) + } + + if x.RpcMetadata == nil { + x.RpcMetadata = new(Message) + } + if defaultValues == nil { + x.RpcMetadata.loadFromEnv(prefix+"RPC_METADATA_", nil) + } else { + x.RpcMetadata.loadFromEnv(prefix+"RPC_METADATA_", defaultValues.RpcMetadata) + } + + if x.RpcBody == nil { + x.RpcBody = new(Message) + } + if defaultValues == nil { + x.RpcBody.loadFromEnv(prefix+"RPC_BODY_", nil) + } else { + x.RpcBody.loadFromEnv(prefix+"RPC_BODY_", defaultValues.RpcBody) + } + + if val, ok := getInt32Env(prefix + "BODY_MAX_SIZE_BYTES"); ok { + x.BodyMaxSizeBytes = &wrappers.Int32Value{Value: val} + } else if x.BodyMaxSizeBytes == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.BodyMaxSizeBytes = new(wrappers.Int32Value) + if defaultValues != nil && defaultValues.BodyMaxSizeBytes != nil { + x.BodyMaxSizeBytes = &wrappers.Int32Value{Value: defaultValues.BodyMaxSizeBytes.Value} + } + } + if val, ok := getInt32Env(prefix + "BODY_MAX_PROCESSING_SIZE_BYTES"); ok { + x.BodyMaxProcessingSizeBytes = &wrappers.Int32Value{Value: val} + } else if x.BodyMaxProcessingSizeBytes == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.BodyMaxProcessingSizeBytes = new(wrappers.Int32Value) + if defaultValues != nil && defaultValues.BodyMaxProcessingSizeBytes != nil { + x.BodyMaxProcessingSizeBytes = &wrappers.Int32Value{Value: defaultValues.BodyMaxProcessingSizeBytes.Value} + } + } + if rawVals, ok := getArrayStringEnv(prefix + "ALLOWED_CONTENT_TYPES"); ok { + for _, val := range rawVals { + x.AllowedContentTypes = append(x.AllowedContentTypes, wrappers.String(val)) + } + } else if len(x.AllowedContentTypes) == 0 && defaultValues != nil && len(defaultValues.AllowedContentTypes) > 0 { + x.AllowedContentTypes = defaultValues.AllowedContentTypes + } + +} + +// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. +func (x *GoAgent) loadFromEnv(prefix string, defaultValues *GoAgent) { + if val, ok := getBoolEnv(prefix + "USE_CUSTOM_BSP"); ok { + x.UseCustomBsp = &wrappers.BoolValue{Value: val} + } else if x.UseCustomBsp == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.UseCustomBsp = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.UseCustomBsp != nil { + x.UseCustomBsp = &wrappers.BoolValue{Value: defaultValues.UseCustomBsp.Value} + } + } +} + +// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized. +func (x *Telemetry) loadFromEnv(prefix string, defaultValues *Telemetry) { + if val, ok := getBoolEnv(prefix + "STARTUP_SPAN_ENABLED"); ok { + x.StartupSpanEnabled = &wrappers.BoolValue{Value: val} + } else if x.StartupSpanEnabled == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.StartupSpanEnabled = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.StartupSpanEnabled != nil { + x.StartupSpanEnabled = &wrappers.BoolValue{Value: defaultValues.StartupSpanEnabled.Value} + } + } + if val, ok := getBoolEnv(prefix + "METRICS_ENABLED"); ok { + x.MetricsEnabled = &wrappers.BoolValue{Value: val} + } else if x.MetricsEnabled == nil { + // when there is no value to set we still prefer to initialize the variable to avoid + // `nil` checks in the consumers. + x.MetricsEnabled = new(wrappers.BoolValue) + if defaultValues != nil && defaultValues.MetricsEnabled != nil { + x.MetricsEnabled = &wrappers.BoolValue{Value: defaultValues.MetricsEnabled.Value} + } + } +} diff --git a/proto/ai/traceable/agent/config/v1/config.proto b/proto/ai/traceable/agent/config/v1/config.proto index 55ba793..ab936ce 100644 --- a/proto/ai/traceable/agent/config/v1/config.proto +++ b/proto/ai/traceable/agent/config/v1/config.proto @@ -20,6 +20,65 @@ message AgentConfig { MetricsConfig metrics_config = 9; // represents the environment name of agent google.protobuf.StringValue environment = 10; + + // From HT config + google.protobuf.StringValue service_name = 11; + + // reporting holds the reporting settings for the agent + Reporting reporting = 12; + + // data_capture describes the data being captured by instrumentation + DataCapture data_capture = 13; + + // propagation_formats list the supported propagation formats + repeated PropagationFormat propagation_formats = 14; + + // when `false`, disables the agent + google.protobuf.BoolValue enabled = 15; + + // resource_attributes map define the static list of resources which is configured on the tracer + map resource_attributes = 16; + + // telemetry + Telemetry telemetry = 17; + + // Goagent specific config + GoAgent goagent = 18; + +} + +// Reporting covers the options related to the mechanics for sending data to the +// tracing server o collector. +message Reporting { + // endpoint represents the endpoint for reporting the traces + // For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans + // For OTLP reporter type use http://api.traceable.ai:4317 + google.protobuf.StringValue endpoint = 1; + + // when `true`, connects to endpoints over TLS. + google.protobuf.BoolValue secure = 2; + + // user specific token to access Traceable API + google.protobuf.StringValue token = 3; + + // reporter type for traces. + TraceReporterType trace_reporter_type = 5; + + // Certificate file containing the CA to verify the server's certificate. + // This is for private certificates. + // If this is set then `secure` above should also be set to `true`. + google.protobuf.StringValue cert_file = 6; + + // metric_endpoint represents the endpoint for reporting the metrics. + // For OTLP metric reporter type use http://api.traceable.ai:4317 + google.protobuf.StringValue metric_endpoint = 7; + + // reporter type for metrics. + MetricReporterType metric_reporter_type = 8; + + // When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing + google.protobuf.BoolValue enable_grpc_loadbalancing = 9; + // represents the agent token to be used by the agent google.protobuf.StringValue agent_token = 11; } @@ -106,6 +165,7 @@ message SamplingConfig { message Javaagent { // set this flag to export certificates configured in JKS to libtraceable for making HTTPS connection to TPA. google.protobuf.BoolValue import_jks_certs = 1; + repeated google.protobuf.StringValue filter_jar_paths = 2; } enum LogMode { @@ -200,3 +260,120 @@ message EdgeDecisionServiceConfig { // specify regexes which will be matched with http.url attribute to exclude spans from EdgeDecisionService evaluation. repeated google.protobuf.StringValue exclude_path_regexes = 5; } + +// Message describes what message should be considered for certain DataCapture option +message Message { + // when `false` it disables the capture for the request in a client/request operation + google.protobuf.BoolValue request = 1; + + // when `false` it disables the capture for the response in a client/request operation + google.protobuf.BoolValue response = 2; +} + +// DataCapture describes the elements to be captured by the agent instrumentation +message DataCapture { + // http_headers enables/disables the capture of the request/response headers in HTTP + Message http_headers = 1; + + // http_body enables/disables the capture of the request/response body in HTTP + Message http_body = 2; + + // rpc_metadata enables/disables the capture of the request/response metadata in RPC + Message rpc_metadata = 3; + + // rpc_body enables/disables the capture of the request/response body in RPC + Message rpc_body = 4; + + // body_max_size_bytes is the maximum size of captured body in bytes. + // Default should be 131_072 (128 KiB). + google.protobuf.Int32Value body_max_size_bytes = 5; + + // body_max_processing_size_bytes is maximum size of body being processed by filters in bytes. + // Default should be 1_048_576 (1MB). + // + // For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes` + // in memory and pass that through the filter. + // For compressed and GRPC bodies, if the size of the body is larger than this, we ignore + // it entirely, otherwise we decompress/decode the body and then pass it to the filter. + google.protobuf.Int32Value body_max_processing_size_bytes = 6; + + // Array of allowed content type substrings to record + // default should be json, x-www-form-urlencoded + // ex: ["json"] will record any request bodies that have a content-type header that includes "json" + repeated google.protobuf.StringValue allowed_content_types = 10; +} + +// PropagationFormat represents the propagation formats supported by agents +enum PropagationFormat { + // B3 propagation format, agents should support both multi and single value formats + // see https://github.com/openzipkin/b3-propagation + B3 = 0; + + // W3C Propagation format + // see https://www.w3.org/TR/trace-context/ + TRACECONTEXT = 1; +} + +// TraceReporterType represents the reporting format for trace data. +enum TraceReporterType { + + // Default to none. Agent will use it's default reporting type + UNSPECIFIED = 0; + + // Zipkin protobuf reporting format. + // see https://github.com/openzipkin/zipkin-api + ZIPKIN = 1; + + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + OTLP = 2; + + // Logging reporting format + LOGGING = 3; + + // Disable trace reporting + NONE = 4; + + // OTLP over http + OTLP_HTTP = 5; +} + +// MetricReporterType represents the reporting format for metric data. +enum MetricReporterType { + + // Default to none. Agent will use it's default reporting type + METRIC_REPORTER_TYPE_UNSPECIFIED = 0; + + // OpenTelemetry protobuf reporting format. + // see https://github.com/open-telemetry/opentelemetry-proto + METRIC_REPORTER_TYPE_OTLP = 1; + + // Prometheus exposition format. + // see https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md + METRIC_REPORTER_TYPE_PROMETHEUS = 2; + + // Logging reporting format + METRIC_REPORTER_TYPE_LOGGING = 3; + + // Disable metric reporting + METRIC_REPORTER_TYPE_NONE = 4; +} + +// GoAgent has the configs specific to goagent +message GoAgent { + // use the custom batch_span_processor adapted from the one in opentelemetry go + // and supports some additional metrics + google.protobuf.BoolValue use_custom_bsp = 1; +} + +// Telemetry has config for agent telemetry: traces and metrics on agent's +// performance and events. +message Telemetry { + // when `true`, an internal span is created and exported when the agent is initialized and started. + // It's useful to denote when the application the agent is in started. + google.protobuf.BoolValue startup_span_enabled = 1; + + // Whether to capture metrics or not. The metrics will be otel go metrics. + // See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric + google.protobuf.BoolValue metrics_enabled = 2; +} diff --git a/tools/env-vars-generator/.dockerignore b/tools/env-vars-generator/.dockerignore new file mode 100644 index 0000000..daf0b63 --- /dev/null +++ b/tools/env-vars-generator/.dockerignore @@ -0,0 +1,3 @@ +# we only need the protos in protobuf/src so we ignore everything else to reduce the context size +protobuf/* +!protobuf/src \ No newline at end of file diff --git a/tools/env-vars-generator/Dockerfile b/tools/env-vars-generator/Dockerfile new file mode 100644 index 0000000..7bc8823 --- /dev/null +++ b/tools/env-vars-generator/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:alpine + +RUN apk add --update git + +ARG WORKDIR=/go/src/github.com/hypertrace/agent-config + +RUN mkdir -p $WORKDIR/tools/env-vars-generator + +WORKDIR $WORKDIR + +COPY . $WORKDIR/tools/env-vars-generator + +# Need the go modules in the WORKDIR +COPY go.* . + +ENTRYPOINT ["/usr/local/go/bin/go", "run", "tools/env-vars-generator/main.go"] \ No newline at end of file diff --git a/tools/env-vars-generator/HEADER.tpl.md b/tools/env-vars-generator/HEADER.tpl.md new file mode 100644 index 0000000..3fb8c9a --- /dev/null +++ b/tools/env-vars-generator/HEADER.tpl.md @@ -0,0 +1,5 @@ +[//]: # (This is the header template for the ENV_VARS.md generated file.) + +# Environment Variables + +Agents can be configured using environment variables: diff --git a/tools/env-vars-generator/README.md b/tools/env-vars-generator/README.md new file mode 100644 index 0000000..0f1ee34 --- /dev/null +++ b/tools/env-vars-generator/README.md @@ -0,0 +1,24 @@ +# Env vars generator + +This tool allows us to generate the [list of env vars](../../ENV_VARS.md) from the [config.proto](../../proto/hypertrace/agent/config/v1/config.proto) file. + +## Usage + +You can run it using docker (if not familiar with Golang): + +```bash +docker build -t hypertrace/agent-config/env-vars-generator . +docker run \ +-v $(PWD)/../../ENV_VARS.md:/usr/local/ENV_VARS.md \ +-v $(PWD)/../../proto/hypertrace/agent/config/v1/config.proto:/usr/local/config.proto \ +hypertrace/agent-config/env-vars-generator \ +-o /usr/local/ENV_VARS.md \ +/usr/local/config.proto +``` + +or using golang directly + +```bash +cd ../.. # back to the main folder +go run tools/env-vars-generator/main.go ./proto/hypertrace/agent/config/v1/config.proto +``` diff --git a/tools/env-vars-generator/go.mod b/tools/env-vars-generator/go.mod new file mode 100644 index 0000000..bedd4c4 --- /dev/null +++ b/tools/env-vars-generator/go.mod @@ -0,0 +1,8 @@ +module github.com/hypertrace/agent-config/tools/env-vars-generator + +go 1.21 + +require ( + github.com/iancoleman/strcase v0.2.0 + github.com/tallstoat/pbparser v0.2.0 +) diff --git a/tools/env-vars-generator/go.sum b/tools/env-vars-generator/go.sum new file mode 100644 index 0000000..bfb8e3a --- /dev/null +++ b/tools/env-vars-generator/go.sum @@ -0,0 +1,4 @@ +github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/tallstoat/pbparser v0.2.0 h1:lsFH4mdiOv1MIQVmge/idThSTd2uByNodWVfbtysjzg= +github.com/tallstoat/pbparser v0.2.0/go.mod h1:aUC6W9uQLeAXZkknve8ZDO6InhRYpYHlJ9kvsQh1i2k= diff --git a/tools/env-vars-generator/main.go b/tools/env-vars-generator/main.go new file mode 100644 index 0000000..76045af --- /dev/null +++ b/tools/env-vars-generator/main.go @@ -0,0 +1,256 @@ +package main + +import ( + "errors" + "flag" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "github.com/iancoleman/strcase" + "github.com/tallstoat/pbparser" +) + +const filepathSeparator = string(filepath.Separator) + +// protobufImportModuleProvider allows to load the wrappers from protobuf library +type protobufImportModuleProvider struct { + dir string +} + +func (pi *protobufImportModuleProvider) Provide(module string) (io.Reader, error) { + modulePath := pi.dir + filepathSeparator + module + if strings.HasPrefix(module, "google/protobuf/") { + modulePath = pi.dir + filepathSeparator + "protobuf" + filepathSeparator + "src" + filepathSeparator + module + } + + raw, err := ioutil.ReadFile(modulePath) + if err != nil { + return nil, err + } + + r := strings.NewReader(string(raw[:])) + return r, nil +} + +func main() { + var outFile = flag.String("o", "./ENV_VARS.md", "OUT_FILE for the generated code.") + var prefix = flag.String("p", "HT_", "Prefix for the env vars.") + flag.Parse() + + if len(flag.Args()) == 0 { + fmt.Println(`Usage: env-vars-generator PROTO_FILE +Parse PROTO_FILE and generate output document`) + return + } + + filename := flag.Arg(0) + f, err := os.Open(filename) + if err != nil { + fmt.Printf("Unable to open the proto file %q: %v", filename, err) + os.Exit(1) + } + + path, err := os.Getwd() + if err != nil { + fmt.Printf("Unable to get current working directory: %v", err) + os.Exit(1) + } + + pf, err := pbparser.Parse(f, &protobufImportModuleProvider{ + path + filepathSeparator + "tools" + filepathSeparator + "env-vars-generator", + }) + if err != nil { + fmt.Printf("Unable to parse proto file %q: %v \n", filename, err) + os.Exit(1) + } + + w, err := os.Create(*outFile) + if err != nil { + fmt.Printf("Failed to open destination %q: %v \n", *outFile, err) + os.Exit(1) + } + defer w.Close() + + _, err = w.WriteString("[//]: # (Code generated by hypertrace/agent-config/tools/env-vars-generator. DO NOT EDIT.)\n\n") + if err != nil { + fmt.Printf("File to write output %v\n", err) + os.Exit(1) + } + + header, err := readTemplate(path + "/tools/env-vars-generator/HEADER.tpl.md") + if err != nil { + fmt.Printf("File to read the header %v\n", err) + os.Exit(1) + } + + _, err = w.Write(header) + if err != nil { + fmt.Printf("File to write output %v\n", err) + os.Exit(1) + } + + allTypes, rootTypes, enumTypes := getTypes(pf) + + for _, _type := range rootTypes { + err = writeHeaders(w) + if err != nil { + fmt.Printf("File to write headers %v \n", err) + os.Exit(1) + } + err = writeRows(w, _type, allTypes, enumTypes, *prefix) + if err != nil { + fmt.Printf("File to write rows %v \n", err) + os.Exit(1) + } + } +} + +// readTemplate reads a template file skipping the comments +func readTemplate(filepath string) ([]byte, error) { + hf, err := os.Open(filepath) + if err != nil { + return nil, err + } + defer hf.Close() + + template, err := ioutil.ReadAll(hf) + if err != nil { + return nil, err + } + + for { + commentIdx := strings.Index(string(template), "[//]: #") + if commentIdx == -1 { + break + } + + newLineIdex := strings.Index(string(template), "\n") + if newLineIdex == -1 { + return nil, errors.New("unable to find new line after comment line") + } + + newTemplate := []byte{} + newTemplate = append(newTemplate, template[:commentIdx]...) + newTemplate = append(newTemplate, template[newLineIdex+1:]...) + template = newTemplate + } + + return template, nil +} + +// readTypes read all types in the proto file to be able to list them and identify those who are +// not part of another type (as a field). +func getTypes(pf pbparser.ProtoFile) ( + map[string]pbparser.MessageElement, + map[string]pbparser.MessageElement, + map[string]pbparser.EnumElement, +) { + allTypes := map[string]pbparser.MessageElement{} + rootTypes := map[string]pbparser.MessageElement{} + enumTypes := map[string]pbparser.EnumElement{} + + for _, m := range pf.Messages { + allTypes[m.Name] = m + rootTypes[m.Name] = m + } + + for _, e := range pf.Enums { + enumTypes[e.Name] = e + } + + for _, m := range pf.Messages { + for _, mf := range m.Fields { + if namedType, ok := mf.Type.(pbparser.NamedDataType); ok { + // if a type is used as a field type in another message then it is not a root type + delete(rootTypes, namedType.Name()) + } + } + } + + return allTypes, rootTypes, enumTypes +} + +func writeHeaders(w io.StringWriter) error { + _, err := w.WriteString(` +| Name | Description | +|------|-------------| +`) + return err +} + +// writeRows write the env var rows in the table +func writeRows( + w io.StringWriter, + m pbparser.MessageElement, + types map[string]pbparser.MessageElement, + enumTypes map[string]pbparser.EnumElement, + prefix string, +) error { + for _, mf := range m.Fields { + if mf.Label == "repeated" { + documentation := strings.Trim(toFieldDescription(mf.Name, mf.Documentation), ".") + + if len(documentation) > 0 { + if e, ok := enumTypes[mf.Type.Name()]; ok { // isEnum + examples := []string{} + for _, ev := range e.EnumConstants[0:2] { // limit example to the first two, excluding unspecified + if !strings.Contains(ev.Name, "UNSPECIFIED") { + examples = append(examples, ev.Name) + } + } + documentation += fmt.Sprintf( + " e.g. `%s=\"%s\"`", + prefix+toEnvFormat(mf.Name), + strings.Join(examples, ","), + ) + } else if strings.HasPrefix(mf.Type.Name(), "google.protobuf.") { + documentation += ". The values should be separated by `,`" + } + + _, err := w.WriteString(fmt.Sprintf( + "| %s | %s. |\n", + prefix+toEnvFormat(mf.Name), + documentation, + )) + if err != nil { + return err + } + } + } else if strings.HasPrefix(mf.Type.Name(), "google.protobuf.") { // i.e. it is scalar + _, err := w.WriteString(fmt.Sprintf( + "| %s | %s |\n", + prefix+toEnvFormat(mf.Name), + toFieldDescription(mf.Name, mf.Documentation), + )) + if err != nil { + return err + } + } else if _, ok := mf.Type.(pbparser.NamedDataType); ok { + err := writeRows(w, types[mf.Type.Name()], types, enumTypes, prefix+toEnvFormat(mf.Name)+"_") + if err != nil { + return err + } + } + } + return nil +} + +func toEnvFormat(name string) string { + return strings.ToUpper(strcase.ToSnake(name)) +} + +func toFieldDescription(name, description string) string { + if len(description) == 0 { + return "" + } + + if strings.HasPrefix(description, name) { + description = strings.Trim(description[len(name)+1:], " ") + } + + return strings.ToUpper(string(description[0])) + description[1:] +} diff --git a/tools/env-vars-generator/main_test.go b/tools/env-vars-generator/main_test.go new file mode 100644 index 0000000..b24378b --- /dev/null +++ b/tools/env-vars-generator/main_test.go @@ -0,0 +1,18 @@ +package main + +import "testing" + +func TestToEnvFormatSuccess(t *testing.T) { + if want, have := "MY_VAR", toEnvFormat("myVar"); want != have { + t.Errorf("Unexpected env format, want %q, have %q", want, have) + } +} + +func TestToFieldDescriptionSuccess(t *testing.T) { + if want, have := "Does something else", toFieldDescription( + "something", + "something does something else", + ); want != have { + t.Errorf("Unexpected env format, want %q, have %q", want, have) + } +} diff --git a/tools/env-vars-generator/protobuf b/tools/env-vars-generator/protobuf new file mode 160000 index 0000000..bd38761 --- /dev/null +++ b/tools/env-vars-generator/protobuf @@ -0,0 +1 @@ +Subproject commit bd3876189e57a897d3ac920be2a050114ed072ff diff --git a/tools/go-generator/Makefile b/tools/go-generator/Makefile new file mode 100644 index 0000000..fc36a5a --- /dev/null +++ b/tools/go-generator/Makefile @@ -0,0 +1,9 @@ +OPT_MODULE ?= github.com/hypertrace/agent-config/gen/go +ENV_PREFIX ?= HT_ + +.PHONY: all +all: # Generates loaders for config proto. + @echo "Generating the loaders" + @cd cmd/generator; go get ./... + @cd cmd/generator; go run . -out $(OUT_DIR) -opt-module $(OPT_MODULE) -env-prefix $(ENV_PREFIX) $(ROOT) + @echo "Done." diff --git a/tools/go-generator/cmd/generator/_protobuf b/tools/go-generator/cmd/generator/_protobuf new file mode 160000 index 0000000..bd38761 --- /dev/null +++ b/tools/go-generator/cmd/generator/_protobuf @@ -0,0 +1 @@ +Subproject commit bd3876189e57a897d3ac920be2a050114ed072ff diff --git a/tools/go-generator/cmd/generator/_templates/envloader.go.tmpl b/tools/go-generator/cmd/generator/_templates/envloader.go.tmpl new file mode 100644 index 0000000..92ceaca --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/envloader.go.tmpl @@ -0,0 +1,15 @@ +{{ .Header}} + +package v1 + +// LoadFromEnv loads env and default values on existing {{ .MainType}} instance +// where defaults only overrides empty values while env vars can override all +// of them. +func (x *{{ .MainType}}) LoadFromEnv(opts ...LoadOption) { + options := defaultOptions + for _, opt := range opts { + opt(&options) + } + + x.loadFromEnv(options.prefix, options.defaultConfig) +} diff --git a/tools/go-generator/cmd/generator/_templates/loader.go.tmpl b/tools/go-generator/cmd/generator/_templates/loader.go.tmpl new file mode 100644 index 0000000..5729ef2 --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/loader.go.tmpl @@ -0,0 +1,166 @@ +{{ .Header}} + +package v1 + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/ghodss/yaml" + "google.golang.org/protobuf/encoding/protojson" +) + +// getBoolEnv returns the bool value for an env var and a confirmation +// if the var exists +func getBoolEnv(name string) (bool, bool) { + val := os.Getenv(name) + switch val { + case "true": + return true, true + case "false": + return false, true + default: + return false, false + } +} + +// getStringEnv returns the string value for an env var and a confirmation +// if the var exists +func getStringEnv(name string) (string, bool) { + if val := os.Getenv(name); val != "" { + return val, true + } + + return "", false +} + +func getArrayStringEnv(name string) ([]string, bool) { + if val := os.Getenv(name); val != "" { + return strings.Split(val, ","), true + } + + return nil, false +} + +// getInt32Env returns the int32 value for an env var and a confirmation +// if the var exists +func getInt32Env(name string) (int32, bool) { + if val := os.Getenv(name); val != "" { + intVal, err := strconv.Atoi(val) + return int32(intVal), err == nil + } + + return 0, false +} + +// getInt64Env returns the int64 value for an env var and a confirmation +// if the var exists +func getInt64Env(name string) (int64, bool) { + if val := os.Getenv(name); val != "" { + intVal, err := strconv.Atoi(val) + if err != nil { + return 0, false + } + return int64(intVal), true + } + + return 0, false +} + +// loadFromFile loads the agent config from a file +func loadFromFile(c *{{ .MainType}}, filename string) error { + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + fcontent, err := ioutil.ReadFile(filename) + if err != nil { + return fmt.Errorf("failed to read file %s: %v", filename, err) + } + switch ext := filepath.Ext(filename); ext { + case ".json": + // The usage of wrappers for scalars in protos make it impossible to use standard + // unmarshalers as the wrapped values aren't scalars but of type Message, hence they + // have object structure in json e.g. myBoolVal: {Value: true} instead of myBoolVal:true + // protojson is meant to solve this problem. + return unmarshaler.Unmarshal(fcontent, c) + case ".yaml", ".yml": + // Because of the reson mentioned above we can't use YAML parsers either and hence + // we convert the YAML into JSON in order to parse the JSON value with protojson. + // The implications of this is that comments and multi-line strings aren't desirable. + fcontentAsJSON, err := yaml.YAMLToJSON(fcontent) + if err != nil { + return fmt.Errorf("failed to parse file %s: %v", filename, err) + } + return unmarshaler.Unmarshal(fcontentAsJSON, c) + default: + return fmt.Errorf("unknown extension: %s", ext) + } +} + +// fileExists checks if a file exists +func fileExists(filename string) bool { + info, err := os.Stat(filename) + if os.IsNotExist(err) { + return false + } + return !info.IsDir() +} + +// Load loads the configuration from the default values, config file and env vars with a given prefix. +func Load(opts ...LoadOption) *{{ .MainType}} { + options := defaultOptions + for _, opt := range opts { + opt(&options) + } + + cfg := {{ .MainType}}{} + + if configFile := os.Getenv(options.prefix + "CONFIG_FILE"); configFile != "" { + absConfigFile, err := filepath.Abs(configFile) + if err != nil { + log.Printf("failed to resolve absolute path for %q: %v.\n", configFile, err) + } + + if fileExists(absConfigFile) { + if err := loadFromFile(&cfg, absConfigFile); err != nil { + log.Printf("failed to load the config from %q: %v\n", absConfigFile, err) + } + } else { + log.Printf("config file %q does not exist.\n", absConfigFile) + } + } + + cfg.loadFromEnv(options.prefix, options.defaultConfig) + + return &cfg +} + +// LoadFromFile loads the configuration from the default values, config file and env vars. +func LoadFromFile(configFile string, opts ...LoadOption) *{{ .MainType}} { + options := defaultOptions + for _, opt := range opts { + opt(&options) + } + + cfg := {{ .MainType}}{} + + absConfigFile, err := filepath.Abs(configFile) + if err != nil { + log.Printf("failed to resolve absolute path for %q: %v.\n", configFile, err) + } + + if fileExists(absConfigFile) { + if err := loadFromFile(&cfg, absConfigFile); err != nil { + log.Printf("failed to load the config from %q: %v\n", absConfigFile, err) + } + } else { + log.Printf("config file %q does not exist.\n", absConfigFile) + } + + cfg.loadFromEnv(options.prefix, options.defaultConfig) + + return &cfg +} diff --git a/tools/go-generator/cmd/generator/_templates/loader_test.go.tmpl b/tools/go-generator/cmd/generator/_templates/loader_test.go.tmpl new file mode 100644 index 0000000..32fb8bb --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/loader_test.go.tmpl @@ -0,0 +1,81 @@ +{{ .Header}} + +package v1 + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestGetInt32Env(t *testing.T) { + _, ok := getInt32Env("my_int") + assert.False(t, ok) + + os.Setenv("my_int", "1") + intVal, ok := getInt32Env("my_int") + assert.True(t, ok) + assert.Equal(t, int32(1), intVal) + + os.Setenv("my_int", "a") + _, ok = getInt32Env("my_int") + assert.False(t, ok) +} + +func TestGetBoolEnv(t *testing.T) { + _, ok := getBoolEnv("my_bool") + assert.False(t, ok) + + os.Setenv("my_bool", "true") + boolVal, ok := getBoolEnv("my_bool") + assert.True(t, ok) + assert.Equal(t, true, boolVal) + + os.Setenv("my_bool", "false") + boolVal, ok = getBoolEnv("my_bool") + assert.True(t, ok) + assert.Equal(t, false, boolVal) + + os.Setenv("my_bool", "x") + _, ok = getBoolEnv("my_bool") + assert.False(t, ok) +} + +func TestGetStringEnv(t *testing.T) { + _, ok := getStringEnv("my_string") + assert.False(t, ok) + + os.Setenv("my_string", "my_value") + stringVal, ok := getStringEnv("my_string") + assert.True(t, ok) + assert.Equal(t, "my_value", stringVal) +} + +func TestGetArrayStringEnv(t *testing.T) { + _, ok := getArrayStringEnv("my_vowels") + assert.False(t, ok) + + os.Setenv("my_vowels", "a,b") + vals, ok := getArrayStringEnv("my_vowels") + assert.True(t, ok) + assert.Equal(t, []string{"a", "b"}, vals) +} + +func TestLoadFromFile(t *testing.T) { + cfg := &{{ .MainType}}{} + err := loadFromFile(cfg, "./testdata/config.yaml") + assert.NoError(t, err) +} + +func TestLoadFromJsonFile(t *testing.T) { + cfg := &{{ .MainType}}{} + err := loadFromFile(cfg, "./testdata/config.json") + assert.NoError(t, err) +} + +func TestLoadFromFileAcceptsUnknownFields(t *testing.T) { + cfg := &{{ .MainType}}{} + err := loadFromFile(cfg, "./testdata/config_with_unknowns.yaml") + assert.NoError(t, err) +} diff --git a/tools/go-generator/cmd/generator/_templates/options.go.tmpl b/tools/go-generator/cmd/generator/_templates/options.go.tmpl new file mode 100644 index 0000000..0b5b99f --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/options.go.tmpl @@ -0,0 +1,40 @@ +{{ .Header}} + +package v1 + +import ( + "log" + + "google.golang.org/protobuf/proto" +) + +type opts struct { + prefix string + defaultConfig *{{ .MainType}} +} + +var defaultOptions = opts { + prefix: "{{ .EnvPrefix}}", + defaultConfig: &{{ .MainType}}{}, +} + +type LoadOption func(o *opts) + +func WithEnvPrefix(prefix string) LoadOption { + return func(o *opts) { + o.prefix = prefix + } +} + +func WithDefaults(defaults *{{ .MainType}}) LoadOption { + return func(o *opts) { + // The reason why we clone the message instead of reusing the one passed by the user + // is because user might decide to change values in runtime and that is undesirable + // without a proper API. + var ok bool + o.defaultConfig, ok = proto.Clone(defaults).(*{{ .MainType}}) + if !ok { + log.Fatal("failed to initialize config.") + } + } +} diff --git a/tools/go-generator/cmd/generator/_templates/testdata/config.json b/tools/go-generator/cmd/generator/_templates/testdata/config.json new file mode 100644 index 0000000..4b18aa1 --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/testdata/config.json @@ -0,0 +1,11 @@ +{ + "reporting": { + "endpoint": "http://myzipkin:9411/api/v2/spans", + "foo": "bar" + }, + "dataCapture": { + "httpBody": { + "response": false + } + } +} \ No newline at end of file diff --git a/tools/go-generator/cmd/generator/_templates/testdata/config.yaml b/tools/go-generator/cmd/generator/_templates/testdata/config.yaml new file mode 100644 index 0000000..63a04f9 --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/testdata/config.yaml @@ -0,0 +1,6 @@ +serviceName: camelService +reporting: + endpoint: "http://35.233.143.122:9411/api/v2/spans" +dataCapture: + httpHeaders: + response: false \ No newline at end of file diff --git a/tools/go-generator/cmd/generator/_templates/testdata/config_with_unknowns.yaml b/tools/go-generator/cmd/generator/_templates/testdata/config_with_unknowns.yaml new file mode 100644 index 0000000..1af5e74 --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/testdata/config_with_unknowns.yaml @@ -0,0 +1 @@ +unknown_field_123: 456 \ No newline at end of file diff --git a/tools/go-generator/cmd/generator/_templates/values.go.tmpl b/tools/go-generator/cmd/generator/_templates/values.go.tmpl new file mode 100644 index 0000000..9ffd11d --- /dev/null +++ b/tools/go-generator/cmd/generator/_templates/values.go.tmpl @@ -0,0 +1,20 @@ +{{ .Header}} + +package v1 + +import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + +// Bool wraps the scalar value to be used in the {{ .MainType}} object +func Bool(val bool) *wrapperspb.BoolValue { + return &wrapperspb.BoolValue{Value: val} +} + +// String wraps the scalar value to be used in the {{ .MainType}} object +func String(val string) *wrapperspb.StringValue { + return &wrapperspb.StringValue{Value: val} +} + +// String wraps the scalar value to be used in the {{ .MainType}} object +func Int32(val int32) *wrapperspb.Int32Value { + return &wrapperspb.Int32Value{Value: val} +} diff --git a/tools/go-generator/cmd/generator/go.mod b/tools/go-generator/cmd/generator/go.mod new file mode 100644 index 0000000..a414106 --- /dev/null +++ b/tools/go-generator/cmd/generator/go.mod @@ -0,0 +1,15 @@ +module github.com/hypertrace/agent-config/tools/go-generator + +go 1.21 + +require ( + github.com/iancoleman/strcase v0.2.0 + github.com/stretchr/testify v1.7.0 + github.com/tallstoat/pbparser v0.2.0 +) + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20220521103104-8f96da9f5d5e // indirect +) diff --git a/tools/go-generator/cmd/generator/go.sum b/tools/go-generator/cmd/generator/go.sum new file mode 100644 index 0000000..9a8cad8 --- /dev/null +++ b/tools/go-generator/cmd/generator/go.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tallstoat/pbparser v0.2.0 h1:lsFH4mdiOv1MIQVmge/idThSTd2uByNodWVfbtysjzg= +github.com/tallstoat/pbparser v0.2.0/go.mod h1:aUC6W9uQLeAXZkknve8ZDO6InhRYpYHlJ9kvsQh1i2k= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20220521103104-8f96da9f5d5e h1:3i3ny04XV6HbZ2N1oIBw1UBYATHAOpo4tfTF83JM3Z0= +gopkg.in/yaml.v3 v3.0.0-20220521103104-8f96da9f5d5e/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/go-generator/cmd/generator/main.go b/tools/go-generator/cmd/generator/main.go new file mode 100644 index 0000000..c8cb4e5 --- /dev/null +++ b/tools/go-generator/cmd/generator/main.go @@ -0,0 +1,362 @@ +package main + +import ( + "flag" + "fmt" + "go/format" + "io" + "log" + "os" + "path" + "path/filepath" + "strings" + + "github.com/iancoleman/strcase" + "github.com/tallstoat/pbparser" +) + +var typeMapForRepeatedFields = map[string]string{ + "google.protobuf.StringValue": "wrappers.String", +} + +func getGoPackageName(pf pbparser.ProtoFile) string { + for _, opt := range pf.Options { + if opt.Name == "go_package" { + return opt.Value + } + } + return pf.PackageName +} + +var zeroValues = map[string]string{ + "string": `""`, + "bool": `false`, +} + +func toPublicFieldName(name string) string { + return strings.Title(name) +} + +func isEnum(pf pbparser.ProtoFile, name string) bool { + for _, e := range pf.Enums { + if e.Name == name { + return true + } + } + + return false +} + +func shouldSkipOtherLanguageAgent(typeName string) bool { + return strings.HasSuffix(typeName, "Agent") && !strings.HasPrefix(typeName, "Go") +} + +func main() { + var outDir = flag.String("out", ".", "Out directory for the generated code.") + var optModule = flag.String("opt-module", ".", "Module for the generated code.") + var envPrefix = flag.String("env-prefix", "HT_", "Prefix for env var loading") + flag.Parse() + + if len(flag.Args()) == 0 { + fmt.Println(`Usage: generator PROTO_FILE +Parse PROTO_FILE and generate output value objects`) + return + } + + rootDir := flag.Arg(0) + + cmdDir, err := os.Getwd() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + err = filepath.Walk( + rootDir, + func(fpath string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if info.IsDir() || !strings.HasSuffix(fpath, ".proto") { + return nil + } + + if err = writeLoadersForProto(cmdDir, fpath, *outDir, *optModule, *envPrefix); err != nil { + return err + } + + return nil + }, + ) + if err != nil { + fmt.Println(err) + os.Exit(1) + } +} + +const generatedHeader = "// Code generated by github.com/hypertrace/agent-config/tools/go-generator. DO NOT EDIT." + +func generateLoaderForProtoFile(pkgFqpn string, pf pbparser.ProtoFile) ([]byte, error) { + c := fmt.Sprintf("%s\n\n", generatedHeader) + c += fmt.Sprintf("package %s\n\n", pkgFqpn[strings.LastIndex(pkgFqpn, "/")+1:]) + // even if we don't need this import, worth to add it as gofmt is going to remove it. + c += "import wrappers \"google.golang.org/protobuf/types/known/wrapperspb\"\n\n" + + for _, m := range pf.Messages { + if shouldSkipOtherLanguageAgent(m.Name) { + continue + } + + mapFields := []pbparser.FieldElement{} + + c += "// loadFromEnv loads the data from env vars, defaults and makes sure all values are initialized.\n" + c += fmt.Sprintf("func (x *%s) loadFromEnv(prefix string, defaultValues *%s) {\n", m.Name, m.Name) + for _, mf := range m.Fields { + if shouldSkipOtherLanguageAgent(mf.Type.Name()) { + continue + } + + if mf.Label == "oneof" { + // currently we don't have a way to handle oneof labels + // in env vars. + continue + } + + fieldName := toPublicFieldName(strcase.ToCamel(mf.Name)) + envPrefix := strings.ToUpper(strcase.ToSnake(mf.Name)) + fieldType := mf.Type.Name() + if mf.Label == "repeated" { + c += fmt.Sprintf( + " if rawVals, ok := getArrayStringEnv(prefix + \"%s\"); ok {\n", + strings.ToUpper(mf.Name), + ) + + if namedType, ok := mf.Type.(pbparser.NamedDataType); ok { + if isEnum(pf, namedType.Name()) { + c += fmt.Sprintf(` vals := []%s{} + for _, rawVal := range rawVals { + vals = append(vals, %s(%s_value[rawVal])) + } + `, namedType.Name(), namedType.Name(), namedType.Name()) + c += fmt.Sprintf(" x.%s = vals\n", fieldName) + } else { + // If this errors need to add additional type & target type cast to typeMapForRepeatedFields + c += fmt.Sprintf(`for _, val := range rawVals { + x.%s = append(x.%s, %s(val)) + }`, fieldName, fieldName, typeMapForRepeatedFields[namedType.Name()]) + } + } + c += fmt.Sprintf(" } else if len(x.%s) == 0 && defaultValues != nil && len(defaultValues.%s) > 0 {\n", fieldName, fieldName) + c += fmt.Sprintf(" x.%s = defaultValues.%s\n", fieldName, fieldName) + c += fmt.Sprintf(" }\n\n") + } else if strings.HasPrefix(fieldType, "google.protobuf.") { + _type := mf.Type.Name()[16 : len(mf.Type.Name())-5] // 16 = len("google.protobuf.") + c += fmt.Sprintf( + " if val, ok := get%sEnv(prefix + \"%s\"); ok {\n", + strings.Title(_type), + envPrefix, + ) + c += fmt.Sprintf(" x.%s = &wrappers.%sValue{Value: val}\n", fieldName, _type) + c += fmt.Sprintf(" } else if x.%s == nil {\n", fieldName) + c += " // when there is no value to set we still prefer to initialize the variable to avoid\n" + c += " // `nil` checks in the consumers.\n" + c += fmt.Sprintf(" x.%s = new(wrappers.%sValue)\n", fieldName, _type) + c += fmt.Sprintf(" if defaultValues != nil && defaultValues.%s != nil {\n", fieldName) + c += fmt.Sprintf(" x.%s = &wrappers.%sValue{Value: defaultValues.%s.Value}\n", fieldName, _type, fieldName) + c += " }\n" + c += " }\n" + } else if namedType, ok := mf.Type.(pbparser.NamedDataType); ok { + if isEnum(pf, namedType.Name()) { + c += fmt.Sprintf( + " if rawVal, ok := getStringEnv(prefix + \"%s\"); ok {\n", + envPrefix, + ) + c += fmt.Sprintf(" x.%s = %s(%s_value[rawVal])\n", fieldName, namedType.Name(), namedType.Name()) + c += fmt.Sprintf(" } else if x.%s == %s(0) && defaultValues != nil && defaultValues.%s != %s(0) {\n", fieldName, fieldName, fieldName, fieldName) + c += fmt.Sprintf(" x.%s = defaultValues.%s\n", fieldName, fieldName) + c += fmt.Sprintf(" }\n\n") + } else { + c += fmt.Sprintf(" if x.%s == nil { x.%s = new(%s) }\n", fieldName, fieldName, namedType.Name()) + c += fmt.Sprintf(" if defaultValues == nil {\n") + c += fmt.Sprintf(" x.%s.loadFromEnv(prefix + \"%s_\", nil)\n", fieldName, envPrefix) + c += fmt.Sprintf(" } else {\n") + c += fmt.Sprintf(" x.%s.loadFromEnv(prefix + \"%s_\", defaultValues.%s)\n", fieldName, envPrefix, fieldName) + c += fmt.Sprintf(" }\n\n") + } + } else if strings.HasPrefix(fieldType, "map") { + mapFields = append(mapFields, mf) + c += fmt.Sprintf(" if defaultValues != nil && len(defaultValues.%s) > 0 {\n", fieldName) + + kType, vType := getSubtypesFromMap(mf.Type.Name()) + c += fmt.Sprintf(" if x.%s == nil { x.%s = make(map[%s]%s) } \n", fieldName, fieldName, kType, vType) + c += fmt.Sprintf(" for k, v := range defaultValues.%s {\n", fieldName) + c += " // defaults should not override existing resource attributes unless empty\n" + c += fmt.Sprintf(" if _, ok := x.%s[k]; !ok {", fieldName) + c += fmt.Sprintf(" x.%s[k] = v\n", fieldName) + c += " }\n" + c += " }\n" + c += " }\n\n" + } else { + c += fmt.Sprintf( + " if val, ok := get%sEnv(prefix + \"%s\"); ok {\n", + strings.Title(fieldType), + envPrefix, + ) + c += fmt.Sprintf(" x.%s = val\n", fieldName) + c += fmt.Sprintf(" } else if x.%s == %s && defaultValues != nil && defaultValues.%s != %s {\n", fieldName, zeroValues[fieldType], fieldName, zeroValues[fieldType]) + c += fmt.Sprintf(" x.%s = defaultValues.%s\n", fieldName, fieldName) + c += fmt.Sprintf(" }\n\n") + } + } + c += "}\n\n" + + if len(mapFields) > 0 { + for _, mf := range mapFields { + addMapFieldSetter(&c, m, mf) + c += "\n" + } + } + } + + bc := []byte(c) + fbc, err := format.Source(bc) + if err != nil { + fmt.Printf("failed to format the content, writing unformatted: %v\n", err) + return bc, nil + } + + return fbc, nil +} + +// writeLoadersForProto generates all the loader config for the proto object +func writeLoadersForProto(cmdDir, protoFilepath, outDir, optModule, envPrefix string) error { + f, err := os.Open(protoFilepath) + if err != nil { + return fmt.Errorf("Unable to open the proto file %q: %v", protoFilepath, err) + } + defer f.Close() + + pf, err := pbparser.Parse(f, &protobufImportModuleProvider{cmdDir}) + if err != nil { + return fmt.Errorf("Unable to parse proto file %q: %v \n", protoFilepath, err) + } + + pkgFqpn := getGoPackageName(pf) + genDstDir := generatedOutputDir(outDir, pkgFqpn, optModule) + + protoLoaderContent, err := generateLoaderForProtoFile(pkgFqpn, pf) + if err != nil { + return fmt.Errorf("failed to generate loaders: %v", err) + } + + err = writeToFile(path.Join(genDstDir, getPBLoaderFilename(protoFilepath)), protoLoaderContent) + if err != nil { + return fmt.Errorf("failed to write loaders file: %v", err) + } + + templateVars := Loaders{ + MainType: "AgentConfig", + Header: generatedHeader, + EnvPrefix: envPrefix, + } + + err = copyTemplateFiles(path.Join(cmdDir, "_templates"), genDstDir, templateVars) + if err != nil { + return fmt.Errorf("failed to copy template files: %v", err) + } + + goModContent, err := generateGoModFile(genDstDir, pkgFqpn) + if err != nil { + return fmt.Errorf("failed to create go.mod file: %v", err) + } + + err = writeToFile(path.Join(path.Dir(genDstDir), "go.mod"), goModContent) + if err != nil { + return fmt.Errorf("failed to write loaders file: %v", err) + } + + err = copyProtoFile(f, genDstDir) + if err != nil { + return fmt.Errorf("failed to write proto file: %v", err) + } + + return nil +} + +func generatedOutputDir(outDir, pkgFqpn, optModule string) string { + return path.Join(outDir, pkgFqpn[len(optModule):]) +} + +func getPBLoaderFilename(protoFilepath string) string { + protoBaseFilename := filepath.Base(protoFilepath) + return protoBaseFilename[0:len(protoBaseFilename)-6] + ".pbloader.go" // 6 = len(".proto") +} + +func generateGoModFile(outDir, pkgname string) ([]byte, error) { + idx := strings.LastIndex(pkgname, "/") + return []byte(fmt.Sprintf("module %s\n", pkgname[:idx])), nil +} + +func getSubtypesFromMap(_type string) (string, string) { + _type = strings.Replace(_type, " ", "", -1) + t := strings.Split(_type[4:len(_type)-1], ",") + if t[0] != "string" || t[1] != "string" { + // While it is possible things work smooth, we better file and refine this rule + // for field map setters. + log.Fatalf("unsupported map subtypes: key %q value %q", t[0], t[1]) + } + + return t[0], t[1] +} + +func addMapFieldSetter(c *string, m pbparser.MessageElement, mf pbparser.FieldElement) { + fieldName := toPublicFieldName(strcase.ToCamel(mf.Name)) + *c += fmt.Sprintf("// Put%s sets values in the %s map.\n", fieldName, fieldName) + + kType, vType := getSubtypesFromMap(mf.Type.Name()) + + *c += fmt.Sprintf("func (x *%s) Put%s(m map[%s]%s) {\n", m.Name, fieldName, kType, vType) + *c += fmt.Sprintf(" if len(m) == 0 { return }\n") + *c += fmt.Sprintf(" if x.%s == nil { x.%s = make(map[%s]%s) } \n", fieldName, fieldName, kType, vType) + *c += " for k, v := range m {\n" + *c += fmt.Sprintf(" x.%s[k] = v\n", fieldName) + *c += " }\n" + *c += "}\n" +} + +func writeToFile(filename string, content []byte) error { + f, err := os.Create(filename) + if err != nil { + return fmt.Errorf("failed to create file %q: %v", filename, err) + } + defer f.Close() + _, err = f.Write(content) + if err != nil { + return fmt.Errorf("failed to write into file %q: %v", filename, err) + } + + return nil +} + +func copyProtoFile(file *os.File, genDstDir string) error { + _, err := file.Seek(0, io.SeekStart) + if err != nil { + return err + } + + protoContent, err := io.ReadAll(file) + if err != nil { + return err + } + + err = os.MkdirAll(path.Join(path.Dir(genDstDir), "proto", "v1"), os.ModePerm) + if err != nil { + return err + } + err = writeToFile(path.Join(path.Dir(genDstDir), "proto", "v1", "config.proto"), protoContent) + if err != nil { + return err + } + return nil +} diff --git a/tools/go-generator/cmd/generator/main_test.go b/tools/go-generator/cmd/generator/main_test.go new file mode 100644 index 0000000..bdf4781 --- /dev/null +++ b/tools/go-generator/cmd/generator/main_test.go @@ -0,0 +1,73 @@ +package main + +import ( + "go/format" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/tallstoat/pbparser" +) + +type MapDataType struct { +} + +func (dt MapDataType) Name() string { + return "map" +} + +func (dt MapDataType) Category() pbparser.DataTypeCategory { + return 99 +} + +func TestSetMapFieldSetter(t *testing.T) { + expectedCode, _ := format.Source([]byte(`// PutMyFields sets values in the MyFields map. + func (x *MyType) PutMyFields(m map[string]string) { + if len(m) == 0 { + return + } + if x.MyFields == nil { + x.MyFields = make(map[string]string) + } + for k, v := range m { + x.MyFields[k] = v + } + } +`)) + + c := "" + m := pbparser.MessageElement{ + Name: "MyType", + } + + mf := pbparser.FieldElement{ + Name: "my_fields", + Type: MapDataType{}, + } + + addMapFieldSetter(&c, m, mf) + + actualCode, err := format.Source([]byte(c)) + require.NoError(t, err) + + assert.Equal(t, string(expectedCode), string(actualCode)) +} + +func TestGetSubtypeFromMap(t *testing.T) { + for _, _type := range []string{"map", "map< string, string>"} { + kType, vType := getSubtypesFromMap(_type) + assert.Equal(t, "string", kType) + assert.Equal(t, "string", vType) + } +} + +func TestGenerateOutputDir(t *testing.T) { + actualDir := generatedOutputDir( + "/path/to/github.com/hypertrace/agent-config/other/pkg", + "github.com/hypertrace/agent-config/some/pkg/v1", + "github.com/hypertrace/agent-config/some/pkg", + ) + + assert.Equal(t, "/path/to/github.com/hypertrace/agent-config/other/pkg/v1", actualDir) +} diff --git a/tools/go-generator/cmd/generator/protobuf.go b/tools/go-generator/cmd/generator/protobuf.go new file mode 100644 index 0000000..f662ce1 --- /dev/null +++ b/tools/go-generator/cmd/generator/protobuf.go @@ -0,0 +1,27 @@ +package main + +import ( + "io" + "io/ioutil" + "path" + "strings" +) + +type protobufImportModuleProvider struct { + dir string +} + +func (pi *protobufImportModuleProvider) Provide(module string) (io.Reader, error) { + modulePath := path.Join(pi.dir, module) + if strings.HasPrefix(module, "google/protobuf/") { + modulePath = path.Join(pi.dir, "_protobuf", "src", module) + } + + raw, err := ioutil.ReadFile(modulePath) + if err != nil { + return nil, err + } + + r := strings.NewReader(string(raw[:])) + return r, nil +} diff --git a/tools/go-generator/cmd/generator/template.go b/tools/go-generator/cmd/generator/template.go new file mode 100644 index 0000000..f204a85 --- /dev/null +++ b/tools/go-generator/cmd/generator/template.go @@ -0,0 +1,49 @@ +package main + +import ( + "html/template" + "os" + "path" + "path/filepath" + "strings" +) + +type Loaders struct { + MainType string + Header string + EnvPrefix string +} + +func copyTemplateFiles(srcDir, outDir string, settings Loaders) error { + return filepath.Walk(srcDir, func(fpath string, info os.FileInfo, err error) error { + if info.IsDir() { + return nil + } + + content, err := os.ReadFile(fpath) + if err != nil { + return err + } + + fileRelativePath := fpath[len(srcDir):] + tmpl := template.Must(template.New(fileRelativePath).Parse(string(content))) + + outputFilepath := path.Join(outDir, fileRelativePath) + if strings.HasSuffix(outputFilepath, ".tmpl") { + outputFilepath = outputFilepath[:len(outputFilepath)-5] + } + + err = os.MkdirAll(path.Dir(outputFilepath), 0755) + if err != nil { + return err + } + + f, err := os.Create(outputFilepath) + if err != nil { + return err + } + defer f.Close() + + return tmpl.Execute(f, settings) + }) +} diff --git a/tools/hypertrace/agent-config b/tools/hypertrace/agent-config deleted file mode 160000 index c23ea67..0000000 --- a/tools/hypertrace/agent-config +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c23ea67314a32edf1a0073d650c5370960db7443