Skip to content

Commit 75b898d

Browse files
committed
chore: support local DSN
1 parent e0ab2b6 commit 75b898d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

uptrace/dsn.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package uptrace
22

33
import (
44
"fmt"
5+
"net"
56
"net/url"
67
)
78

@@ -23,7 +24,11 @@ func (dsn *DSN) AppHost() string {
2324
if dsn.Host == "uptrace.dev" {
2425
return "app.uptrace.dev"
2526
}
26-
return dsn.Host
27+
host, _, err := net.SplitHostPort(dsn.Host)
28+
if err != nil {
29+
return dsn.Host
30+
}
31+
return net.JoinHostPort(host, "15678")
2732
}
2833

2934
func (dsn *DSN) OTLPHost() string {
@@ -59,7 +64,7 @@ func ParseDSN(dsnStr string) (*DSN, error) {
5964
if dsn.Host == "api.uptrace.dev" {
6065
dsn.Host = "uptrace.dev"
6166
}
62-
if dsn.Host == "uptrace.dev" {
67+
if dsn.Host != "uptrace.dev" {
6368
return &dsn, nil
6469
}
6570

0 commit comments

Comments
 (0)