Skip to content

Commit

Permalink
otlp: mark unix endpoints to work without transport security
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Jun 14, 2021
1 parent 3be9813 commit 282dcb5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -122,6 +122,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898)
- Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931)
- Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973)
- Avoid transport security when otlp endpoint is a Unix socket. (#2001)

### Security

Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/internal/otlpconfig/envconfig.go
Expand Up @@ -138,7 +138,7 @@ func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption {
}

func isInsecureEndpoint(endpoint string) bool {
return strings.HasPrefix(strings.ToLower(endpoint), "http://")
return strings.HasPrefix(strings.ToLower(endpoint), "http://") || strings.HasPrefix(strings.ToLower(endpoint), "unix://")
}

func trimSchema(endpoint string) string {
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlptrace/internal/otlpconfig/envconfig.go
Expand Up @@ -137,7 +137,7 @@ func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption {
}

func isInsecureEndpoint(endpoint string) bool {
return strings.HasPrefix(strings.ToLower(endpoint), "http://")
return strings.HasPrefix(strings.ToLower(endpoint), "http://") || strings.HasPrefix(strings.ToLower(endpoint), "unix://")
}

func trimSchema(endpoint string) string {
Expand Down

0 comments on commit 282dcb5

Please sign in to comment.