Skip to content

Commit

Permalink
fix(backend): tempo cloud connection string (#3515)
Browse files Browse the repository at this point in the history
* fix(backend): tempo cloud connection string

* adding suggested change
  • Loading branch information
xoscar authored Jan 11, 2024
1 parent bd6d3a1 commit dc5f609
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion server/tracedb/connection/port_linting.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,15 @@ func parsePort(url string) string {
return ""
}

return regexGroups[1]
port := regexGroups[1]

if port == "1" {
if strings.Contains(url, "http") {
return "80"
} else {
return "443"
}
}

return port
}
4 changes: 4 additions & 0 deletions server/tracedb/datasource/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ type HttpClient struct {

func NewHttpClient(name string, config *datastore.HttpClientConfig, callback HttpCallback) DataSource {
endpoint, _ := urlx.Parse(config.Url)
if endpoint.Port() == "443" {
endpoint.Scheme = "https"
}

client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: getTlsConfig(config.TLS),
Expand Down
2 changes: 1 addition & 1 deletion server/tracedb/tempodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func tempoDefaultPorts() []string {
return []string{"9095", ""}
return []string{"9095", "443", "80", ""}
}

type tempoTraceDB struct {
Expand Down

0 comments on commit dc5f609

Please sign in to comment.