Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Combine constants and reuse port #415

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

package jaeger

import "github.com/opentracing/opentracing-go"
import (
"fmt"

"github.com/opentracing/opentracing-go"
)

const (
// JaegerClientVersion is the version of the client library reported as Span tag.
Expand Down Expand Up @@ -95,3 +99,8 @@ const (
// with an already defined context.
selfRefType opentracing.SpanReferenceType = 99
)

var (
// DefaultSamplingServerURL is the default url to fetch sampling config from, via http
DefaultSamplingServerURL = fmt.Sprintf("http://localhost:%d/sampling", DefaultSamplingServerPort)
)
3 changes: 1 addition & 2 deletions sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
)

const (
defaultSamplingServerURL = "http://localhost:5778/sampling"
defaultSamplingRefreshInterval = time.Minute
defaultMaxOperations = 2000
)
Expand Down Expand Up @@ -435,7 +434,7 @@ func applySamplerOptions(opts ...SamplerOption) samplerOptions {
options.maxOperations = defaultMaxOperations
}
if options.samplingServerURL == "" {
options.samplingServerURL = defaultSamplingServerURL
options.samplingServerURL = DefaultSamplingServerURL
}
if options.metrics == nil {
options.metrics = NewNullMetrics()
Expand Down