Skip to content

Commit 80ca2b1

Browse files
tonistiigiMrAlias
andauthored
otlp: mark unix endpoints to work without transport security (#2001)
Signed-off-by: Tonis Tiigi <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
1 parent 6514098 commit 80ca2b1

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
122122
- Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898)
123123
- Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931)
124124
- Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973)
125+
- Avoid transport security when otlp endpoint is a Unix socket. (#2001)
125126

126127
### Security
127128

exporters/otlp/otlpmetric/internal/otlpconfig/envconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption {
138138
}
139139

140140
func isInsecureEndpoint(endpoint string) bool {
141-
return strings.HasPrefix(strings.ToLower(endpoint), "http://")
141+
return strings.HasPrefix(strings.ToLower(endpoint), "http://") || strings.HasPrefix(strings.ToLower(endpoint), "unix://")
142142
}
143143

144144
func trimSchema(endpoint string) string {

exporters/otlp/otlptrace/internal/otlpconfig/envconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption {
137137
}
138138

139139
func isInsecureEndpoint(endpoint string) bool {
140-
return strings.HasPrefix(strings.ToLower(endpoint), "http://")
140+
return strings.HasPrefix(strings.ToLower(endpoint), "http://") || strings.HasPrefix(strings.ToLower(endpoint), "unix://")
141141
}
142142

143143
func trimSchema(endpoint string) string {

0 commit comments

Comments
 (0)