-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Traceableai/adding-proto-go-mod
- Loading branch information
Showing
5 changed files
with
188 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
syntax = "proto3"; | ||
|
||
package ai.traceable.agent.config.v1; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
option go_package = "github.com/Traceableai/agent-config/gen/go/v1"; | ||
|
||
message AgentConfig { | ||
Opa opa = 1 [deprecated = true]; | ||
BlockingConfig blocking_config = 2; | ||
google.protobuf.BoolValue debug_log = 3 [deprecated = true]; | ||
RemoteConfig remote_config = 4; | ||
ApiDiscoveryConfig api_discovery = 5 [deprecated = true]; | ||
SamplingConfig sampling = 6; | ||
// javaagent has the configs specific to javaagent | ||
Javaagent javaagent = 7; | ||
LogConfig logging = 8; | ||
MetricsConfig metrics_config = 9; | ||
// represents the environment name of agent | ||
google.protobuf.StringValue environment = 10; | ||
} | ||
|
||
// Opa covers the options related to the mechanics for getting Open Policy Agent configuration file. | ||
// The client should use secure and token option from reporting settings. | ||
message Opa { | ||
// when `true` Open Policy Agent evaluation is enabled to block request | ||
google.protobuf.BoolValue enabled = 1; | ||
|
||
// endpoint represents the endpoint for polling OPA config file e.g. http://opa.traceableai:8181/ | ||
google.protobuf.StringValue endpoint = 2; | ||
|
||
// poll period in seconds to query OPA service | ||
google.protobuf.Int32Value poll_period_seconds = 3; | ||
|
||
// Certificate filename containing the CA to verify the server's certificate. | ||
// If this is non-empty, you shoulds `https` for the protocol in `endpoint` above. | ||
google.protobuf.StringValue cert_file = 4; | ||
// set this flag to use https connection when the provided certificate path is empty | ||
google.protobuf.BoolValue use_secure_connection = 5; | ||
} | ||
|
||
// Blocking config | ||
message BlockingConfig { | ||
google.protobuf.BoolValue enabled = 1; | ||
// debug_log has moved to top level | ||
google.protobuf.BoolValue debug_log = 2 [deprecated = true]; | ||
ModsecurityConfig modsecurity = 3; | ||
google.protobuf.BoolValue evaluate_body = 4; | ||
RegionBlockingConfig region_blocking = 5; | ||
// remote_config has moved to top level | ||
RemoteConfig remote_config = 6 [deprecated = true]; | ||
|
||
// when `true`, blocking evaluation will be skipped for internal requests i.e. requests coming | ||
// from private IPs | ||
google.protobuf.BoolValue skip_internal_request = 7; | ||
|
||
// Allows user to set a custom blocking status code value | ||
google.protobuf.Int32Value response_status_code = 8; | ||
|
||
// setting a maximum allowed depth for recursion while parsing combination policies | ||
google.protobuf.Int32Value max_recursion_depth = 9; | ||
|
||
// Allows user to set a custom blocking message | ||
google.protobuf.StringValue response_message = 10; | ||
} | ||
|
||
message ModsecurityConfig { | ||
google.protobuf.BoolValue enabled = 1; | ||
} | ||
|
||
message RegionBlockingConfig { | ||
google.protobuf.BoolValue enabled = 1; | ||
} | ||
|
||
// RemoteConfig defines the remote endpoint where the config is fetched from | ||
message RemoteConfig { | ||
// enabled denotes if config needs to be fetched from remote or not | ||
google.protobuf.BoolValue enabled = 1; | ||
// endpoint denotes the agentmanager endpoint to connect to for config. eg: localhost:5441 | ||
google.protobuf.StringValue endpoint = 2; | ||
// poll period in seconds to query for config updates | ||
google.protobuf.Int32Value poll_period_seconds = 3; | ||
// Certificate filename containing the CA to verify the server's certificate. | ||
google.protobuf.StringValue cert_file = 4; | ||
google.protobuf.Int32Value grpc_max_call_recv_msg_size = 5; | ||
// set this flag to use https connection when the provided certificate path is empty | ||
google.protobuf.BoolValue use_secure_connection = 6; | ||
} | ||
|
||
message ApiDiscoveryConfig { | ||
google.protobuf.BoolValue enabled = 1; | ||
} | ||
|
||
message SamplingConfig { | ||
google.protobuf.BoolValue enabled = 1; | ||
RateLimitConfig default_rate_limit_config = 2; | ||
} | ||
|
||
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; | ||
} | ||
|
||
enum LogMode { | ||
LOG_MODE_UNSPECIFIED = 0; | ||
LOG_MODE_NONE = 1; | ||
LOG_MODE_STDOUT = 2; | ||
LOG_MODE_FILE = 3; | ||
} | ||
|
||
enum LogLevel { | ||
LOG_LEVEL_UNSPECIFIED = 0; | ||
LOG_LEVEL_TRACE = 1; | ||
LOG_LEVEL_DEBUG = 2; | ||
LOG_LEVEL_INFO = 3; | ||
LOG_LEVEL_WARN = 4; | ||
LOG_LEVEL_ERROR = 5; | ||
LOG_LEVEL_CRITICAL = 6; | ||
} | ||
|
||
message LogConfig { | ||
LogMode log_mode = 1; | ||
LogLevel log_level = 2; | ||
// if mode is LOG_MODE_FILE, provide this additional configuration | ||
LogFileConfig log_file = 3; | ||
} | ||
|
||
message LogFileConfig { | ||
// maximum number of log files to keep | ||
google.protobuf.Int32Value max_files = 1; | ||
// maximum file size of the log files. Default value is 10485760 (10MB). | ||
google.protobuf.Int32Value max_file_size = 2; | ||
// file path for the log file. Default value is /var/traceable/log/libtraceable.log | ||
google.protobuf.StringValue file_path = 3; | ||
} | ||
|
||
message MetricsLogConfig { | ||
// set this flag to print metrics in logs | ||
google.protobuf.BoolValue enabled = 1; | ||
// set the frequency at which metrics should be printed. Examples are '1s', '2m', '3h'. Default value is 30m | ||
google.protobuf.StringValue frequency = 2; | ||
} | ||
|
||
message EndpointMetricsConfig { | ||
// set this flag to enable endpoint level metrics | ||
google.protobuf.BoolValue enabled = 1; | ||
// set the max number of endpoints to track | ||
google.protobuf.Int32Value max_endpoints = 2; | ||
// config for printing endpoint metrics in logs | ||
MetricsLogConfig logging = 3; | ||
} | ||
|
||
message MetricsConfig { | ||
// set this flag to enable metrics | ||
google.protobuf.BoolValue enabled = 1; | ||
// endpoint level configuration | ||
EndpointMetricsConfig endpoint_config = 2; | ||
// config for printing metrics in logs | ||
MetricsLogConfig logging = 3; | ||
} | ||
|
||
enum SpanType { | ||
SPAN_TYPE_UNSPECIFIED = 0; | ||
SPAN_TYPE_NO_SPAN = 1; | ||
SPAN_TYPE_BARE_SPAN = 2; | ||
SPAN_TYPE_FULL_SPAN = 3; | ||
} | ||
|
||
message RateLimitConfig { | ||
// set this flag to enable rate limiter | ||
google.protobuf.BoolValue enabled = 1; | ||
// total number of requests to be rate limited in a given time window | ||
google.protobuf.Int64Value max_count_global = 2; | ||
// number of requests per endpoint to be rate limited in a given time window | ||
google.protobuf.Int64Value max_count_per_endpoint = 3; | ||
// set the interval for rate limiter buckets to be reset. Examples are '1s', '2m', '3h'. | ||
google.protobuf.StringValue refresh_period = 4; | ||
// set the interval for rate limiter cache to be reset. Examples are '1s', '2m', '3h'. | ||
google.protobuf.StringValue value_expiration_period = 5; | ||
// set the span type for rate limited spans | ||
SpanType span_type = 6; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Submodule agent-config
updated
12 files
+1 −0 | ENV_VARS.md | |
+2 −2 | gen/go/go.mod | |
+4 −4 | gen/go/go.sum | |
+199 −0 | gen/go/proto/v1/config.proto | |
+245 −163 | gen/go/v1/config.pb.go | |
+23 −0 | gen/go/v1/config.pbloader.go | |
+14 −0 | gen/go/v1/loader.go | |
+10 −0 | proto/hypertrace/agent/config/v1/config.proto | |
+1 −1 | tools/env-vars-generator/protobuf | |
+1 −1 | tools/go-generator/cmd/generator/_protobuf | |
+28 −0 | tools/go-generator/cmd/generator/main.go | |
+1 −2 | tools/go-generator/cmd/generator/template.go |