Skip to content

Commit

Permalink
Minor stylistic cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
  • Loading branch information
joonas committed Oct 1, 2024
1 parent 56a33cf commit d6d9945
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ const (
// OtelProtocol returns the configured OpenTelemetry protocol if one is provided,
// otherwise defaulting to http.
func (config *OtelConfig) OtelProtocol() string {
protocol := OtelProtocolHTTP
if config.Protocol != "" {
protocol = strings.ToLower(config.Protocol)
return strings.ToLower(config.Protocol)
}
return protocol

return OtelProtocolHTTP
}

// TracesURL returns the configured TracesEndpoint as-is if one is provided,
Expand Down Expand Up @@ -123,11 +123,11 @@ func (config *OtelConfig) resolveSignalUrl(signal otelSignal) string {
}

func (config *OtelConfig) defaultEndpoint() string {
endpoint := OtelExporterHttpEndpoint
if config.OtelProtocol() == OtelProtocolGRPC {
endpoint = OtelExporterGrpcEndpoint
return OtelExporterGrpcEndpoint
}
return endpoint

return OtelExporterHttpEndpoint
}

func (config *OtelConfig) defaultSignalPath(signal otelSignal) string {
Expand Down

0 comments on commit d6d9945

Please sign in to comment.