You've already forked opentelemetry-go
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:
committed by
GitHub
parent
c0c5ef65eb
commit
e209ee7585
@@ -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{}
|
||||
|
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user