Skip to content

Commit

Permalink
Combine constants and reuse port (jaegertracing#415)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <ys@uber.com>
  • Loading branch information
yurishkuro authored Aug 13, 2019
1 parent 7148435 commit e8ef996
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit e8ef996

Please sign in to comment.