Skip to content

Commit d8f22ee

Browse files
committed
Fix TLS related docs and TLS config name for Server side settings
commit 4607209 Author: Min Xia <[email protected]> Date: Thu Sep 16 13:33:52 2021 -0700 Do not squash `configtls.TLSClientSetting` in `confighttp` and `cnofiggrpc` config
1 parent e056aa8 commit d8f22ee

File tree

11 files changed

+44
-29
lines changed

11 files changed

+44
-29
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
- Remove AttributeMessageType (#4020)
99
- Remove `mem-ballast-size-mib`, already deprecated and no-op (#4005).
1010
- Remove `AttributeHTTPStatusText` const, replaced with `"http.status_text"` (#4015, contrib/#5182).
11+
- Remove squash on `configtls.TLSClientSetting` and move TLS client configs under `tls` (#4063).
12+
- Rename TLS server config `*configtls.TLSServerSetting` from `tls_settings` to `tls` (#4063).
1113

1214
## v0.35.0 Beta
1315

config/configauth/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ receivers:
2222
protocols:
2323
grpc:
2424
endpoint: localhost:4318
25-
tls_settings:
25+
tls:
2626
cert_file: /tmp/certs/cert.pem
2727
key_file: /tmp/certs/cert-key.pem
2828
auth:

config/configgrpc/README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ adjusted.
1010
[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md)
1111
leverage client configuration.
1212

13-
Note that client configuration supports TLS configuration, however
14-
configuration parameters are not defined under `tls_settings` like server
13+
Note that client configuration supports TLS configuration, the
14+
configuration parameters are also defined under `tls` like server
1515
configuration. For more information, see [configtls
1616
README](../configtls/README.md).
1717

1818
- [`balancer_name`](https://github.com/grpc/grpc-go/blob/master/examples/features/load_balancing/README.md)
1919
- `compression` (default = gzip): Compression type to use (only gzip is supported today)
2020
- `endpoint`: Valid value syntax available [here](https://github.com/grpc/grpc/blob/master/doc/naming.md)
21+
- [`tls`](../configtls/README.md)
2122
- `headers`: name/value pairs added to the request
2223
- [`keepalive`](https://godoc.org/google.golang.org/grpc/keepalive#ClientParameters)
2324
- `permit_without_stream`
@@ -34,6 +35,10 @@ Example:
3435
exporters:
3536
otlp:
3637
endpoint: otelcol2:55690
38+
tls:
39+
ca_file: ca.pem
40+
cert_file: cert.pem
41+
key_file: key.pem
3742
headers:
3843
test1: "value1"
3944
"test 2": "value 2"
@@ -60,5 +65,5 @@ see [confignet README](../confignet/README.md).
6065
- [`max_concurrent_streams`](https://godoc.org/google.golang.org/grpc#MaxConcurrentStreams)
6166
- [`max_recv_msg_size_mib`](https://godoc.org/google.golang.org/grpc#MaxRecvMsgSize)
6267
- [`read_buffer_size`](https://godoc.org/google.golang.org/grpc#ReadBufferSize)
63-
- [`tls_settings`](../configtls/README.md)
68+
- [`tls`](../configtls/README.md)
6469
- [`write_buffer_size`](https://godoc.org/google.golang.org/grpc#WriteBufferSize)

config/configgrpc/configgrpc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type GRPCClientSettings struct {
7373
Compression string `mapstructure:"compression"`
7474

7575
// TLSSetting struct exposes TLS client configuration.
76-
TLSSetting configtls.TLSClientSetting `mapstructure:",squash"`
76+
TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"`
7777

7878
// The keepalive parameters for gRPC client. See grpc.WithKeepaliveParams.
7979
// (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
@@ -134,7 +134,7 @@ type GRPCServerSettings struct {
134134

135135
// Configures the protocol to use TLS.
136136
// The default value is nil, which will cause the protocol to not use TLS.
137-
TLSSetting *configtls.TLSServerSetting `mapstructure:"tls_settings,omitempty"`
137+
TLSSetting *configtls.TLSServerSetting `mapstructure:"tls,omitempty"`
138138

139139
// MaxRecvMsgSizeMiB sets the maximum size (in MiB) of messages accepted by the server.
140140
MaxRecvMsgSizeMiB uint64 `mapstructure:"max_recv_msg_size_mib"`

config/confighttp/README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ receivers or exporters.
99
[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md)
1010
leverage client configuration.
1111

12-
Note that client configuration supports TLS configuration, however
13-
configuration parameters are not defined under `tls_settings` like server
12+
Note that client configuration supports TLS configuration, the
13+
configuration parameters are also defined under `tls` like server
1414
configuration. For more information, see [configtls
1515
README](../configtls/README.md).
1616

1717
- `endpoint`: address:port
18+
- [`tls`](../configtls/README.md)
1819
- `headers`: name/value pairs added to the HTTP request headers
1920
- [`read_buffer_size`](https://golang.org/pkg/net/http/#Transport)
2021
- [`timeout`](https://golang.org/pkg/net/http/#Client)
@@ -26,6 +27,10 @@ Example:
2627
exporter:
2728
otlp:
2829
endpoint: otelcol2:55690
30+
tls:
31+
ca_file: ca.pem
32+
cert_file: cert.pem
33+
key_file: key.pem
2934
headers:
3035
test1: "value1"
3136
"test 2": "value 2"
@@ -44,7 +49,7 @@ leverage server configuration.
4449
`Content-Type`, `X-Requested-With`. `Origin` is also always
4550
added to the list. A wildcard (`*`) can be used to match any header.
4651
- `endpoint`: Valid value syntax available [here](https://github.com/grpc/grpc/blob/master/doc/naming.md)
47-
- [`tls_settings`](../configtls/README.md)
52+
- [`tls`](../configtls/README.md)
4853

4954
Example:
5055

config/confighttp/confighttp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type HTTPClientSettings struct {
3838
Endpoint string `mapstructure:"endpoint"`
3939

4040
// TLSSetting struct exposes TLS client configuration.
41-
TLSSetting configtls.TLSClientSetting `mapstructure:",squash"`
41+
TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"`
4242

4343
// ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize.
4444
ReadBufferSize int `mapstructure:"read_buffer_size"`
@@ -140,7 +140,7 @@ type HTTPServerSettings struct {
140140
Endpoint string `mapstructure:"endpoint"`
141141

142142
// TLSSetting struct exposes TLS client configuration.
143-
TLSSetting *configtls.TLSServerSetting `mapstructure:"tls_settings, omitempty"`
143+
TLSSetting *configtls.TLSServerSetting `mapstructure:"tls, omitempty"`
144144

145145
// CorsOrigins are the allowed CORS origins for HTTP/JSON requests to grpc-gateway adapter
146146
// for the OTLP receiver. See github.com/rs/cors

config/configtls/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ See below for examples.
4848
[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md)
4949
leverage client configuration.
5050

51-
Note that client configuration supports TLS configuration, however
52-
configuration parameters are not defined under `tls_settings` like server
51+
Note that client configuration supports TLS configuration, the
52+
configuration parameters are also defined under `tls` like server
5353
configuration. For more information, see [configtls
5454
README](../configtls/README.md).
5555

@@ -66,11 +66,12 @@ exporters:
6666
otlp:
6767
endpoint: myserver.local:55690
6868
insecure: false
69-
ca_file: server.crt
70-
cert_file: client.crt
71-
key_file: client.key
72-
min_version: "1.1"
73-
max_version: "1.2"
69+
tls:
70+
ca_file: server.crt
71+
cert_file: client.crt
72+
key_file: client.key
73+
min_version: "1.1"
74+
max_version: "1.2"
7475
otlp/insecure:
7576
endpoint: myserver.local:55690
7677
insecure: true
@@ -101,14 +102,14 @@ receivers:
101102
protocols:
102103
grpc:
103104
endpoint: mysite.local:55690
104-
tls_settings:
105+
tls:
105106
cert_file: server.crt
106107
key_file: server.key
107108
otlp/mtls:
108109
protocols:
109110
grpc:
110111
endpoint: mysite.local:55690
111-
tls_settings:
112+
tls:
112113
client_ca_file: client.pem
113114
cert_file: server.crt
114115
key_file: server.key

exporter/otlpexporter/testdata/config.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ exporters:
1212
otlp/2:
1313
endpoint: "1.2.3.4:1234"
1414
compression: "on"
15-
ca_file: /var/lib/mycert.pem
15+
tls:
16+
ca_file: /var/lib/mycert.pem
1617
timeout: 10s
1718
sending_queue:
1819
enabled: true

exporter/otlphttpexporter/testdata/config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ exporters:
88
otlphttp:
99
otlphttp/2:
1010
endpoint: "https://1.2.3.4:1234"
11-
insecure: true
12-
ca_file: /var/lib/mycert.pem
13-
cert_file: certfile
14-
key_file: keyfile
11+
tls:
12+
ca_file: /var/lib/mycert.pem
13+
cert_file: certfile
14+
key_file: keyfile
15+
insecure: true
1516
timeout: 10s
1617
read_buffer_size: 123
1718
write_buffer_size: 345

receiver/otlpreceiver/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Config defines configuration for OTLP receiver.
2222
| ---- | ---- | ------- | ---- |
2323
| endpoint |string| 0.0.0.0:4317 | Endpoint configures the address for this network connection. For TCP and UDP networks, the address has the form "host:port". The host must be a literal IP address, or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name. If the host is a literal IPv6 address it must be enclosed in square brackets, as in "[2001:db8::1]:80" or "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007. |
2424
| transport |string| tcp | Transport to use. Known protocols are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket". |
25-
| tls_settings |[configtls-TLSServerSetting](#configtls-TLSServerSetting)| <no value> | Configures the protocol to use TLS. The default value is nil, which will cause the protocol to not use TLS. |
25+
| tls |[configtls-TLSServerSetting](#configtls-TLSServerSetting)| <no value> | Configures the protocol to use TLS. The default value is nil, which will cause the protocol to not use TLS. |
2626
| max_recv_msg_size_mib |uint64| <no value> | MaxRecvMsgSizeMiB sets the maximum size (in MiB) of messages accepted by the server. |
2727
| max_concurrent_streams |uint32| <no value> | MaxConcurrentStreams sets the limit on the number of concurrent streams to each ServerTransport. It has effect only for streaming RPCs. |
2828
| read_buffer_size |int| 524288 | ReadBufferSize for gRPC server. See grpc.ReadBufferSize (https://godoc.org/google.golang.org/grpc#ReadBufferSize). |
@@ -74,7 +74,7 @@ Config defines configuration for OTLP receiver.
7474
| Name | Type | Default | Docs |
7575
| ---- | ---- | ------- | ---- |
7676
| endpoint |string| 0.0.0.0:4318 | Endpoint configures the listening address for the server. |
77-
| tls_settings |[configtls-TLSServerSetting](#configtls-TLSServerSetting)| <no value> | TLSSetting struct exposes TLS client configuration. |
77+
| tls |[configtls-TLSServerSetting](#configtls-TLSServerSetting)| <no value> | TLSSetting struct exposes TLS client configuration. |
7878
| cors_allowed_origins |[]string| <no value> | CorsOrigins are the allowed CORS origins for HTTP/JSON requests to grpc-gateway adapter for the OTLP receiver. See github.com/rs/cors An empty list means that CORS is not enabled at all. A wildcard (*) can be used to match any origin or one or more characters of an origin. |
7979
| cors_allowed_headers |[]string| <no value> | CorsHeaders are the allowed CORS headers for HTTP/JSON requests to grpc-gateway adapter for the OTLP receiver. See github.com/rs/cors CORS needs to be enabled first by providing a non-empty list in CorsOrigins A wildcard (*) can be used to match any header. |
8080

receiver/otlpreceiver/testdata/config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ receivers:
5454
otlp/tlscredentials:
5555
protocols:
5656
grpc:
57-
tls_settings:
57+
tls:
5858
cert_file: test.crt
5959
key_file: test.key
6060
http:
61-
tls_settings:
61+
tls:
6262
cert_file: test.crt
6363
key_file: test.key
6464
# The following entry demonstrates how to specify a Unix Domain Socket for the server.

0 commit comments

Comments
 (0)