1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-09-16 09:26:25 +02:00

chore(exporter/zipkin): improves logging on invalid collector. (#2191)

* chore(exporter/zipkin): improves logging on invalid collector.

* tests: fixes tests.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
José Carlos Chávez
2021-08-30 20:29:22 +02:00
committed by GitHub
parent c0c5ef65eb
commit e209ee7585
2 changed files with 3 additions and 3 deletions

View File

@@ -91,10 +91,10 @@ func New(collectorURL string, opts ...Option) (*Exporter, error) {
}
u, err := url.Parse(collectorURL)
if err != nil {
return nil, fmt.Errorf("invalid collector URL: %v", err)
return nil, fmt.Errorf("invalid collector URL %q: %v", collectorURL, err)
}
if u.Scheme == "" || u.Host == "" {
return nil, errors.New("invalid collector URL")
return nil, fmt.Errorf("invalid collector URL %q: no scheme or host", collectorURL)
}
cfg := config{}

View File

@@ -71,7 +71,7 @@ func TestNewRawExporterShouldFailInvalidCollectorURL(t *testing.T) {
)
assert.Error(t, err)
assert.EqualError(t, err, "invalid collector URL")
assert.EqualError(t, err, "invalid collector URL \"localhost\": no scheme or host")
assert.Nil(t, exp)
}