You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-17 01:12:45 +02:00
trace exporter: using type names for return values (#648)
* trace exporter: using type names for return values * Update jaeger.go Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
This commit is contained in:
@ -56,28 +56,28 @@ type options struct {
|
|||||||
// WithOnError sets the hook to be called when there is
|
// WithOnError sets the hook to be called when there is
|
||||||
// an error occurred when uploading the span data.
|
// an error occurred when uploading the span data.
|
||||||
// If no custom hook is set, errors are logged.
|
// 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) {
|
return func(o *options) {
|
||||||
o.OnError = onError
|
o.OnError = onError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithProcess sets the process with the information about the exporting process.
|
// 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) {
|
return func(o *options) {
|
||||||
o.Process = process
|
o.Process = process
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//WithBufferMaxCount defines the total number of traces that can be buffered in memory
|
//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) {
|
return func(o *options) {
|
||||||
o.BufferMaxCount = bufferMaxCount
|
o.BufferMaxCount = bufferMaxCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithSDK sets the SDK config for the exporter pipeline.
|
// 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) {
|
return func(o *options) {
|
||||||
o.Config = config
|
o.Config = config
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ func WithSDK(config *sdktrace.Config) func(o *options) {
|
|||||||
|
|
||||||
// RegisterAsGlobal enables the registration of the trace provider of the new pipeline
|
// RegisterAsGlobal enables the registration of the trace provider of the new pipeline
|
||||||
// as Global Trace Provider.
|
// as Global Trace Provider.
|
||||||
func RegisterAsGlobal() func(o *options) {
|
func RegisterAsGlobal() Option {
|
||||||
return func(o *options) {
|
return func(o *options) {
|
||||||
o.RegisterGlobal = true
|
o.RegisterGlobal = true
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ type EndpointOption func() (batchUploader, error)
|
|||||||
|
|
||||||
// WithAgentEndpoint instructs exporter to send spans to jaeger-agent at this address.
|
// WithAgentEndpoint instructs exporter to send spans to jaeger-agent at this address.
|
||||||
// For example, localhost:6831.
|
// For example, localhost:6831.
|
||||||
func WithAgentEndpoint(agentEndpoint string) func() (batchUploader, error) {
|
func WithAgentEndpoint(agentEndpoint string) EndpointOption {
|
||||||
return func() (batchUploader, error) {
|
return func() (batchUploader, error) {
|
||||||
if agentEndpoint == "" {
|
if agentEndpoint == "" {
|
||||||
return nil, errors.New("agentEndpoint must not be empty")
|
return nil, errors.New("agentEndpoint must not be empty")
|
||||||
@ -53,7 +53,7 @@ func WithAgentEndpoint(agentEndpoint string) func() (batchUploader, error) {
|
|||||||
|
|
||||||
// WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector.
|
// WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector.
|
||||||
// For example, http://localhost:14268/api/traces
|
// 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) {
|
return func() (batchUploader, error) {
|
||||||
if collectorEndpoint == "" {
|
if collectorEndpoint == "" {
|
||||||
return nil, errors.New("collectorEndpoint must not be empty")
|
return nil, errors.New("collectorEndpoint must not be empty")
|
||||||
@ -83,14 +83,14 @@ type CollectorEndpointOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WithUsername sets the username to be used if basic auth is required.
|
// 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) {
|
return func(o *CollectorEndpointOptions) {
|
||||||
o.username = username
|
o.username = username
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithPassword sets the password to be used if basic auth is required.
|
// 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) {
|
return func(o *CollectorEndpointOptions) {
|
||||||
o.password = password
|
o.password = password
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user