Skip to content

Commit 2898828

Browse files
committed
fix(sdk): endpoint building
1 parent 23d2bf9 commit 2898828

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

traceloop-sdk/tracing.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,10 @@ import (
1515
)
1616

1717
func newTraceloopExporter(ctx context.Context, config Config) (*otlp.Exporter, error) {
18-
// WithEndpoint expects host:port format, no protocol or path
19-
endpoint := config.BaseURL
20-
// Remove protocol if present since WithEndpoint doesn't accept it
21-
if strings.HasPrefix(endpoint, "https://") {
22-
endpoint = strings.TrimPrefix(endpoint, "https://")
23-
}
24-
if strings.HasPrefix(endpoint, "http://") {
25-
endpoint = strings.TrimPrefix(endpoint, "http://")
26-
}
27-
28-
// Add default HTTPS port if no port specified
29-
if !strings.Contains(endpoint, ":") {
30-
endpoint = endpoint + ":443"
31-
}
32-
3318
return otlp.New(
3419
ctx,
3520
otlphttp.NewClient(
36-
otlphttp.WithEndpoint(endpoint),
37-
otlphttp.WithURLPath("/v1/traces"),
21+
otlphttp.WithEndpoint(config.BaseURL),
3822
otlphttp.WithHeaders(
3923
map[string]string{
4024
"Authorization": fmt.Sprintf("Bearer %s", config.APIKey),

0 commit comments

Comments
 (0)