|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package hypertrace.agent.config.v1; |
| 4 | + |
| 5 | +import "google/protobuf/wrappers.proto"; |
| 6 | + |
| 7 | +option go_package = "github.com/hypertrace/agent-config/gen/go/v1"; |
| 8 | +option java_package = "org.hypertrace.agent.config.v1"; |
| 9 | +option csharp_namespace = "Hypertrace.Agent.Config.V1"; |
| 10 | + |
| 11 | +// AgentConfig covers the config for agents. |
| 12 | +// The config uses wrappers for primitive types to allow nullable values. |
| 13 | +// The nullable values are used for instance to explicitly disable data capture or secure connection. |
| 14 | +// Since the wrappers change structure of the objects the marshalling and unmarshalling |
| 15 | +// have to be done via protobuf marshallers. |
| 16 | +message AgentConfig { |
| 17 | + // service_name identifies the service/process running e.g. "my service" |
| 18 | + google.protobuf.StringValue service_name = 1; |
| 19 | + |
| 20 | + // reporting holds the reporting settings for the agent |
| 21 | + Reporting reporting = 2; |
| 22 | + |
| 23 | + // data_capture describes the data being captured by instrumentation |
| 24 | + DataCapture data_capture = 3; |
| 25 | + |
| 26 | + // propagation_formats list the supported propagation formats |
| 27 | + repeated PropagationFormat propagation_formats = 4; |
| 28 | + |
| 29 | + // when `false`, disables the agent |
| 30 | + google.protobuf.BoolValue enabled = 5; |
| 31 | + |
| 32 | + // javaagent has the configs specific to javaagent |
| 33 | + JavaAgent javaagent = 6; |
| 34 | + |
| 35 | + // resource_attributes map define the static list of resources which is configured on the tracer |
| 36 | + map<string, string> resource_attributes = 7; |
| 37 | + |
| 38 | + // telemetry |
| 39 | + Telemetry telemetry = 8; |
| 40 | + |
| 41 | + // Goagent specific config |
| 42 | + GoAgent goagent = 9; |
| 43 | +} |
| 44 | + |
| 45 | +// Reporting covers the options related to the mechanics for sending data to the |
| 46 | +// tracing server o collector. |
| 47 | +message Reporting { |
| 48 | + // endpoint represents the endpoint for reporting the traces |
| 49 | + // For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans |
| 50 | + // For OTLP reporter type use http://api.traceable.ai:4317 |
| 51 | + google.protobuf.StringValue endpoint = 1; |
| 52 | + |
| 53 | + // when `true`, connects to endpoints over TLS. |
| 54 | + google.protobuf.BoolValue secure = 2; |
| 55 | + |
| 56 | + // user specific token to access Traceable API |
| 57 | + google.protobuf.StringValue token = 3; |
| 58 | + |
| 59 | + // reporter type for traces. |
| 60 | + TraceReporterType trace_reporter_type = 5; |
| 61 | + |
| 62 | + // Certificate file containing the CA to verify the server's certificate. |
| 63 | + // This is for private certificates. |
| 64 | + // If this is set then `secure` above should also be set to `true`. |
| 65 | + google.protobuf.StringValue cert_file = 6; |
| 66 | + |
| 67 | + // metric_endpoint represents the endpoint for reporting the metrics. |
| 68 | + // For OTLP metric reporter type use http://api.traceable.ai:4317 |
| 69 | + google.protobuf.StringValue metric_endpoint = 7; |
| 70 | + |
| 71 | + // reporter type for metrics. |
| 72 | + MetricReporterType metric_reporter_type = 8; |
| 73 | + |
| 74 | + // When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing |
| 75 | + google.protobuf.BoolValue enable_grpc_loadbalancing = 9; |
| 76 | +} |
| 77 | + |
| 78 | +// Message describes what message should be considered for certain DataCapture option |
| 79 | +message Message { |
| 80 | + // when `false` it disables the capture for the request in a client/request operation |
| 81 | + google.protobuf.BoolValue request = 1; |
| 82 | + |
| 83 | + // when `false` it disables the capture for the response in a client/request operation |
| 84 | + google.protobuf.BoolValue response = 2; |
| 85 | +} |
| 86 | + |
| 87 | +// DataCapture describes the elements to be captured by the agent instrumentation |
| 88 | +message DataCapture { |
| 89 | + // http_headers enables/disables the capture of the request/response headers in HTTP |
| 90 | + Message http_headers = 1; |
| 91 | + |
| 92 | + // http_body enables/disables the capture of the request/response body in HTTP |
| 93 | + Message http_body = 2; |
| 94 | + |
| 95 | + // rpc_metadata enables/disables the capture of the request/response metadata in RPC |
| 96 | + Message rpc_metadata = 3; |
| 97 | + |
| 98 | + // rpc_body enables/disables the capture of the request/response body in RPC |
| 99 | + Message rpc_body = 4; |
| 100 | + |
| 101 | + // body_max_size_bytes is the maximum size of captured body in bytes. |
| 102 | + // Default should be 131_072 (128 KiB). |
| 103 | + google.protobuf.Int32Value body_max_size_bytes = 5; |
| 104 | + |
| 105 | + // body_max_processing_size_bytes is maximum size of body being processed by filters in bytes. |
| 106 | + // Default should be 1_048_576 (1MB). |
| 107 | + // |
| 108 | + // For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes` |
| 109 | + // in memory and pass that through the filter. |
| 110 | + // For compressed and GRPC bodies, if the size of the body is larger than this, we ignore |
| 111 | + // it entirely, otherwise we decompress/decode the body and then pass it to the filter. |
| 112 | + google.protobuf.Int32Value body_max_processing_size_bytes = 6; |
| 113 | + |
| 114 | + // Array of allowed content type substrings to record |
| 115 | + // default should be json, x-www-form-urlencoded |
| 116 | + // ex: ["json"] will record any request bodies that have a content-type header that includes "json" |
| 117 | + repeated google.protobuf.StringValue allowed_content_types = 10; |
| 118 | +} |
| 119 | + |
| 120 | +// PropagationFormat represents the propagation formats supported by agents |
| 121 | +enum PropagationFormat { |
| 122 | + // B3 propagation format, agents should support both multi and single value formats |
| 123 | + // see https://github.com/openzipkin/b3-propagation |
| 124 | + B3 = 0; |
| 125 | + |
| 126 | + // W3C Propagation format |
| 127 | + // see https://www.w3.org/TR/trace-context/ |
| 128 | + TRACECONTEXT = 1; |
| 129 | +} |
| 130 | + |
| 131 | +// TraceReporterType represents the reporting format for trace data. |
| 132 | +enum TraceReporterType { |
| 133 | + |
| 134 | + // Default to none. Agent will use it's default reporting type |
| 135 | + UNSPECIFIED = 0; |
| 136 | + |
| 137 | + // Zipkin protobuf reporting format. |
| 138 | + // see https://github.com/openzipkin/zipkin-api |
| 139 | + ZIPKIN = 1; |
| 140 | + |
| 141 | + // OpenTelemetry protobuf reporting format. |
| 142 | + // see https://github.com/open-telemetry/opentelemetry-proto |
| 143 | + OTLP = 2; |
| 144 | + |
| 145 | + // Logging reporting format |
| 146 | + LOGGING = 3; |
| 147 | + |
| 148 | + // Disable trace reporting |
| 149 | + NONE = 4; |
| 150 | + |
| 151 | + // OTLP over http |
| 152 | + OTLP_HTTP = 5; |
| 153 | +} |
| 154 | + |
| 155 | +// MetricReporterType represents the reporting format for metric data. |
| 156 | +enum MetricReporterType { |
| 157 | + |
| 158 | + // Default to none. Agent will use it's default reporting type |
| 159 | + METRIC_REPORTER_TYPE_UNSPECIFIED = 0; |
| 160 | + |
| 161 | + // OpenTelemetry protobuf reporting format. |
| 162 | + // see https://github.com/open-telemetry/opentelemetry-proto |
| 163 | + METRIC_REPORTER_TYPE_OTLP = 1; |
| 164 | + |
| 165 | + // Prometheus exposition format. |
| 166 | + // see https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md |
| 167 | + METRIC_REPORTER_TYPE_PROMETHEUS = 2; |
| 168 | + |
| 169 | + // Logging reporting format |
| 170 | + METRIC_REPORTER_TYPE_LOGGING = 3; |
| 171 | + |
| 172 | + // Disable metric reporting |
| 173 | + METRIC_REPORTER_TYPE_NONE = 4; |
| 174 | +} |
| 175 | + |
| 176 | +// JavaAgent has the configs specific to javaagent |
| 177 | +message JavaAgent { |
| 178 | + // filter_jar_paths is the list of path to filter jars, separated by `,` |
| 179 | + repeated google.protobuf.StringValue filter_jar_paths = 1; |
| 180 | +} |
| 181 | + |
| 182 | +// GoAgent has the configs specific to goagent |
| 183 | +message GoAgent { |
| 184 | + // use the custom batch_span_processor adapted from the one in opentelemetry go |
| 185 | + // and supports some additional metrics |
| 186 | + google.protobuf.BoolValue use_custom_bsp = 1; |
| 187 | +} |
| 188 | + |
| 189 | +// Telemetry has config for agent telemetry: traces and metrics on agent's |
| 190 | +// performance and events. |
| 191 | +message Telemetry { |
| 192 | + // when `true`, an internal span is created and exported when the agent is initialized and started. |
| 193 | + // It's useful to denote when the application the agent is in started. |
| 194 | + google.protobuf.BoolValue startup_span_enabled = 1; |
| 195 | + |
| 196 | + // Whether to capture metrics or not. The metrics will be otel go metrics. |
| 197 | + // See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric |
| 198 | + google.protobuf.BoolValue metrics_enabled = 2; |
| 199 | +} |
0 commit comments