Skip to content

Commit

Permalink
trace exporter: using type names for return values (#648)
Browse files Browse the repository at this point in the history
* trace exporter: using type names for return values

* Update jaeger.go

Co-authored-by: Joshua MacDonald <[email protected]>
  • Loading branch information
moorara and jmacd authored Apr 22, 2020
1 parent 927d915 commit ddad4d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions exporters/trace/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,36 @@ type options struct {
// WithOnError sets the hook to be called when there is
// an error occurred when uploading the span data.
// If no custom hook is set, errors are logged.
func WithOnError(onError func(err error)) func(o *options) {
func WithOnError(onError func(err error)) Option {
return func(o *options) {
o.OnError = onError
}
}

// WithProcess sets the process with the information about the exporting process.
func WithProcess(process Process) func(o *options) {
func WithProcess(process Process) Option {
return func(o *options) {
o.Process = process
}
}

//WithBufferMaxCount defines the total number of traces that can be buffered in memory
func WithBufferMaxCount(bufferMaxCount int) func(o *options) {
func WithBufferMaxCount(bufferMaxCount int) Option {
return func(o *options) {
o.BufferMaxCount = bufferMaxCount
}
}

// WithSDK sets the SDK config for the exporter pipeline.
func WithSDK(config *sdktrace.Config) func(o *options) {
func WithSDK(config *sdktrace.Config) Option {
return func(o *options) {
o.Config = config
}
}

// RegisterAsGlobal enables the registration of the trace provider of the new pipeline
// as Global Trace Provider.
func RegisterAsGlobal() func(o *options) {
func RegisterAsGlobal() Option {
return func(o *options) {
o.RegisterGlobal = true
}
Expand Down
8 changes: 4 additions & 4 deletions exporters/trace/jaeger/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type EndpointOption func() (batchUploader, error)

// WithAgentEndpoint instructs exporter to send spans to jaeger-agent at this address.
// For example, localhost:6831.
func WithAgentEndpoint(agentEndpoint string) func() (batchUploader, error) {
func WithAgentEndpoint(agentEndpoint string) EndpointOption {
return func() (batchUploader, error) {
if agentEndpoint == "" {
return nil, errors.New("agentEndpoint must not be empty")
Expand All @@ -53,7 +53,7 @@ func WithAgentEndpoint(agentEndpoint string) func() (batchUploader, error) {

// WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector.
// For example, http://localhost:14268/api/traces
func WithCollectorEndpoint(collectorEndpoint string, options ...CollectorEndpointOption) func() (batchUploader, error) {
func WithCollectorEndpoint(collectorEndpoint string, options ...CollectorEndpointOption) EndpointOption {
return func() (batchUploader, error) {
if collectorEndpoint == "" {
return nil, errors.New("collectorEndpoint must not be empty")
Expand Down Expand Up @@ -83,14 +83,14 @@ type CollectorEndpointOptions struct {
}

// WithUsername sets the username to be used if basic auth is required.
func WithUsername(username string) func(o *CollectorEndpointOptions) {
func WithUsername(username string) CollectorEndpointOption {
return func(o *CollectorEndpointOptions) {
o.username = username
}
}

// WithPassword sets the password to be used if basic auth is required.
func WithPassword(password string) func(o *CollectorEndpointOptions) {
func WithPassword(password string) CollectorEndpointOption {
return func(o *CollectorEndpointOptions) {
o.password = password
}
Expand Down

0 comments on commit ddad4d4

Please sign in to comment.