Skip to content

Commit

Permalink
chore(exporter/zipkin): improves logging on invalid collector. (#2191)
Browse files Browse the repository at this point in the history
* chore(exporter/zipkin): improves logging on invalid collector.

* tests: fixes tests.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
  • Loading branch information
jcchavezs and Aneurysm9 committed Aug 30, 2021
1 parent c0c5ef6 commit e209ee7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions exporters/zipkin/zipkin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion exporters/zipkin/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit e209ee7

Please sign in to comment.