Skip to content

Commit 5d62ffc

Browse files
committed
chore: output api changes
Signed-off-by: Bence Csati <[email protected]>
1 parent 24278b2 commit 5d62ffc

File tree

6 files changed

+382
-67
lines changed

6 files changed

+382
-67
lines changed

api/telemetry/v1alpha1/otlp_config.go

+49-11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"go.opentelemetry.io/collector/config/configopaque"
2222
)
2323

24+
// TimeoutSettings for timeout. The timeout applies to individual attempts to send data to the backend.
2425
type TimeoutSettings struct {
2526
// Timeout is the timeout for every attempt to send data to the backend.
2627
// A zero timeout means no timeout.
@@ -29,12 +30,18 @@ type TimeoutSettings struct {
2930

3031
// QueueSettings defines configuration for queueing batches before sending to the consumerSender.
3132
type QueueSettings struct {
32-
// NumConsumers is the number of consumers from the queue.
33+
// NumConsumers is the number of consumers from the queue. Defaults to 10.
34+
// If batching is enabled, a combined batch cannot contain more requests than the number of consumers.
35+
// So it's recommended to set higher number of consumers if batching is enabled.
3336
NumConsumers *int `json:"num_consumers,omitempty"`
3437

3538
// QueueSize is the maximum number of batches allowed in queue at a given time.
3639
// Default value is 100.
3740
QueueSize *int `json:"queue_size,omitempty"`
41+
42+
// Blocking controls the queue behavior when full.
43+
// If true it blocks until enough space to add the new request to the queue.
44+
Blocking *bool `json:"blocking,omitempty"`
3845
}
3946

4047
// BackOffConfig defines configuration for retrying batches in case of export failure.
@@ -122,11 +129,9 @@ type TLSClientSetting struct {
122129

123130
// These are config options specific to client connections.
124131

125-
// In gRPC when set to true, this is used to disable the client transport security.
126-
// See https://godoc.org/google.golang.org/grpc#WithInsecure.
127-
// In HTTP, this disables verifying the server's certificate chain and host name
128-
// (InsecureSkipVerify in the tls Config). Please refer to
129-
// https://godoc.org/crypto/tls#Config for more information.
132+
// In gRPC and HTTP when set to true, this is used to disable the client transport security.
133+
// See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC.
134+
// Please refer to https://godoc.org/crypto/tls#Config for more information.
130135
// (optional, default false)
131136
Insecure bool `json:"insecure,omitempty"`
132137

@@ -151,6 +156,10 @@ type TLSSetting struct {
151156
// In memory PEM encoded cert. (optional)
152157
CAPem string `json:"ca_pem,omitempty"`
153158

159+
// If true, load system CA certificates pool in addition to the certificates
160+
// configured in this struct.
161+
IncludeSystemCACertsPool bool `json:"include_system_ca_certs_pool,omitempty"`
162+
154163
// Path to the TLS cert to use for TLS required connections. (optional)
155164
CertFile string `json:"cert_file,omitempty"`
156165

@@ -171,17 +180,37 @@ type TLSSetting struct {
171180
// If not set, refer to crypto/tls for defaults. (optional)
172181
MaxVersion string `json:"max_version,omitempty"`
173182

183+
// CipherSuites is a list of TLS cipher suites that the TLS transport can use.
184+
// If left blank, a safe default list is used.
185+
// See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
186+
CipherSuites []string `json:"cipher_suites,omitempty"`
187+
174188
// ReloadInterval specifies the duration after which the certificate will be reloaded
175189
// If not set, it will never be reloaded (optional)
176190
ReloadInterval time.Duration `json:"reload_interval,omitempty"`
191+
192+
// contains the elliptic curves that will be used in
193+
// an ECDHE handshake, in preference order
194+
// Defaults to empty list and "crypto/tls" defaults are used, internally.
195+
CurvePreferences []string `json:"curve_preferences,omitempty"`
177196
}
178197

179198
type Authentication struct {
180199
// AuthenticatorID specifies the name of the extension to use in order to authenticate the incoming data point.
181200
AuthenticatorID *string `json:"authenticator,omitempty"`
182201
}
183202

184-
// ClientConfig defines settings for creating an HTTP client.
203+
type CompressionParams struct {
204+
Level *int `json:"level,omitempty"`
205+
}
206+
207+
// CookiesConfig defines the configuration of the HTTP client regarding cookies served by the server.
208+
type CookiesConfig struct {
209+
// Enabled if true, cookies from HTTP responses will be reused in further HTTP requests with the same server.
210+
Enabled bool `json:"enabled,omitempty"`
211+
}
212+
213+
// HTTPClientConfig defines settings for creating an HTTP client.
185214
type HTTPClientConfig struct {
186215
// The target URL to send data to (e.g.: http://some.url:9411/v1/traces).
187216
Endpoint *string `json:"endpoint,omitempty"`
@@ -193,12 +222,15 @@ type HTTPClientConfig struct {
193222
TLSSetting *TLSClientSetting `json:"tls,omitempty"`
194223

195224
// ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize.
225+
// Default is 0.
196226
ReadBufferSize *int `json:"read_buffer_size,omitempty"`
197227

198228
// WriteBufferSize for HTTP client. See http.Transport.WriteBufferSize.
229+
// Default is 0.
199230
WriteBufferSize *int `json:"write_buffer_size,omitempty"`
200231

201232
// Timeout parameter configures `http.Client.Timeout`.
233+
// Default is 0 (unlimited).
202234
Timeout *time.Duration `json:"timeout,omitempty"`
203235

204236
// Additional headers attached to each HTTP request sent by the client.
@@ -212,21 +244,24 @@ type HTTPClientConfig struct {
212244
// The compression key for supported compression types within collector.
213245
Compression *configcompression.Type `json:"compression,omitempty"`
214246

247+
// Advanced configuration options for the Compression
248+
CompressionParams *CompressionParams `json:"compression_params,omitempty"`
249+
215250
// MaxIdleConns is used to set a limit to the maximum idle HTTP connections the client can keep open.
216-
// There's an already set value, and we want to override it only if an explicit value provided
251+
// By default, it is set to 100.
217252
MaxIdleConns *int `json:"max_idle_conns,omitempty"`
218253

219254
// MaxIdleConnsPerHost is used to set a limit to the maximum idle HTTP connections the host can keep open.
220-
// There's an already set value, and we want to override it only if an explicit value provided
255+
// By default, it is set to [http.DefaultTransport.MaxIdleConnsPerHost].
221256
MaxIdleConnsPerHost *int `json:"max_idle_conns_per_host,omitempty"`
222257

223258
// MaxConnsPerHost limits the total number of connections per host, including connections in the dialing,
224259
// active, and idle states.
225-
// There's an already set value, and we want to override it only if an explicit value provided
260+
// By default, it is set to [http.DefaultTransport.MaxConnsPerHost].
226261
MaxConnsPerHost *int `json:"max_conns_per_host,omitempty"`
227262

228263
// IdleConnTimeout is the maximum amount of time a connection will remain open before closing itself.
229-
// There's an already set value, and we want to override it only if an explicit value provided
264+
// By default, it is set to [http.DefaultTransport.IdleConnTimeout]
230265
IdleConnTimeout *time.Duration `json:"idle_conn_timeout,omitempty"`
231266

232267
// DisableKeepAlives, if true, disables HTTP keep-alives and will only use the connection to the server
@@ -247,4 +282,7 @@ type HTTPClientConfig struct {
247282
// HTTP2PingTimeout if there's no response to the ping within the configured value, the connection will be closed.
248283
// If not set or set to 0, it defaults to 15s.
249284
HTTP2PingTimeout *time.Duration `json:"http2_ping_timeout,omitempty"`
285+
286+
// Cookies configures the cookie management of the HTTP client.
287+
Cookies *CookiesConfig `json:"cookies,omitempty"`
250288
}

api/telemetry/v1alpha1/output_types.go

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ type OTLPHTTP struct {
100100
QueueConfig *QueueSettings `json:"sending_queue,omitempty"`
101101
RetryConfig *BackOffConfig `json:"retry_on_failure,omitempty"`
102102
HTTPClientConfig `json:",inline"`
103+
104+
// +kubebuilder:validation:Enum:=proto;json
105+
106+
// The encoding to export telemetry (default: "proto")
107+
Encoding *string `json:"encoding,omitempty"`
103108
}
104109

105110
type Endpoint struct {

api/telemetry/v1alpha1/zz_generated.deepcopy.go

+55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)