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

implement all jaeger config options #1341

Merged
merged 3 commits into from
Jun 7, 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
24 changes: 5 additions & 19 deletions cmd/metrictank/metrictank.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/grafana/globalconf"
"github.com/grafana/metrictank/api"
"github.com/grafana/metrictank/cluster"
"github.com/grafana/metrictank/conf"
"github.com/grafana/metrictank/idx"
"github.com/grafana/metrictank/idx/bigtable"
"github.com/grafana/metrictank/idx/cassandra"
Expand All @@ -29,6 +28,7 @@ import (
inCarbon "github.com/grafana/metrictank/input/carbon"
inKafkaMdm "github.com/grafana/metrictank/input/kafkamdm"
inPrometheus "github.com/grafana/metrictank/input/prometheus"
"github.com/grafana/metrictank/jaeger"
"github.com/grafana/metrictank/logger"
"github.com/grafana/metrictank/mdata"
"github.com/grafana/metrictank/mdata/cache"
Expand Down Expand Up @@ -75,10 +75,6 @@ var (
proftrigFreqStr = flag.String("proftrigger-freq", "60s", "inspect status frequency. set to 0 to disable")
proftrigMinDiffStr = flag.String("proftrigger-min-diff", "1h", "minimum time between triggered profiles")
proftrigHeapThresh = flag.Int("proftrigger-heap-thresh", 25000000000, "if this many bytes allocated, trigger a profile")

tracingEnabled = flag.Bool("tracing-enabled", false, "enable/disable distributed opentracing via jaeger")
tracingAddr = flag.String("tracing-addr", "localhost:6831", "address of the jaeger agent to send data to")
tracingAddTags = flag.String("tracing-add-tags", "", "tracer/process-level tags to include, specified as comma-separated key:value pairs")
)

func main() {
Expand Down Expand Up @@ -133,6 +129,8 @@ func main() {
// bigtable store
bigtableStore.ConfigSetup()

jaeger.ConfigSetup()

config.ParseAll()

/***********************************
Expand Down Expand Up @@ -185,6 +183,7 @@ func main() {
cassandra.ConfigProcess()
bigtable.ConfigProcess()
bigtableStore.ConfigProcess(mdata.MaxChunkSpan())
jaeger.ConfigProcess()

inputEnabled := inCarbon.Enabled || inKafkaMdm.Enabled || inPrometheus.Enabled
wantInput := cluster.Mode == cluster.ModeDev || cluster.Mode == cluster.ModeShard
Expand Down Expand Up @@ -243,20 +242,7 @@ func main() {
/***********************************
Initialize tracer
***********************************/
*tracingAddTags = strings.TrimSpace(*tracingAddTags)
var tags map[string]string
if len(*tracingAddTags) > 0 {
tagSpecs := strings.Split(*tracingAddTags, ",")
tags = make(map[string]string)
for _, tagSpec := range tagSpecs {
split := strings.Split(tagSpec, ":")
if len(split) != 2 {
log.Fatalf("cannot parse tracing-add-tags value %q", tagSpec)
}
tags[split[0]] = split[1]
}
}
tracer, traceCloser, err := conf.GetTracer(*tracingEnabled, *tracingAddr, tags)
tracer, traceCloser, err := jaeger.Get()
if err != nil {
log.Fatalf("Could not initialize jaeger tracer: %s", err.Error())
}
Expand Down
8 changes: 6 additions & 2 deletions cmd/mt-store-cat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/grafana/globalconf"
"github.com/grafana/metrictank/conf"
"github.com/grafana/metrictank/jaeger"
"github.com/grafana/metrictank/logger"
"github.com/grafana/metrictank/store/cassandra"
opentracing "github.com/opentracing/opentracing-go"
Expand Down Expand Up @@ -150,6 +150,10 @@ func main() {
os.Exit(1)
}

jaeger.ConfigSetup()
jaeger.ConfigProcess()
jaeger.Enabled = false

config.ParseAll()

if *groupTTL != "s" && *groupTTL != "m" && *groupTTL != "h" && *groupTTL != "d" {
Expand Down Expand Up @@ -178,7 +182,7 @@ func main() {
if err != nil {
log.Fatalf("failed to initialize cassandra. %s", err.Error())
}
tracer, traceCloser, err := conf.GetTracer(false, "", nil)
tracer, traceCloser, err := jaeger.Get()
if err != nil {
log.Fatalf("Could not initialize jaeger tracer: %s", err.Error())
}
Expand Down
47 changes: 0 additions & 47 deletions conf/tracing.go

This file was deleted.

46 changes: 40 additions & 6 deletions docker/docker-chaos/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and lower (read right to left: to the left is lower). panic|fatal|error|warning|info|debug
log-level = info

# enable/disable distributed opentracing via jaeger
tracing-enabled = true
# address of the jaeger agent to send data to
tracing-addr = jaeger:6831
# tracer/process-level tags to include, specified as comma-separated key:value pairs
tracing-add-tags =
## request tracing via jaeger ##
[jaeger]
# Whether the tracer is enabled or not
enabled = true
# A comma separated list of name = value tracer level tags, which get added to all reported spans.
# The value can also refer to an environment variable using the format ${envVarName:default},
# where the :default is optional, and identifies a value to be used if the environment variable cannot be found
add-tags =
# the type of the sampler: const, probabilistic, rateLimiting, or remote
sampler-type = const
# The sampler parameter (number)
# - for "const" sampler, 0 or 1 for always false/true respectively
# - for "probabilistic" sampler, a probability between 0 and 1
# - for "rateLimiting" sampler, the number of spans per second
# - for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership.
sampler-param = 1
# The HTTP endpoint when using the remote sampler
sampler-manager-addr = "http://jaeger:5778/sampling"
# The maximum number of operations that the sampler will keep track of.
# If an operation is not tracked, a default probabilistic
# sampler will be used rather than the per operation specific sampler.
sampler-max-operations = 0
# How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy
sampler-refresh-interval = 10s
# The reporter's maximum queue size
reporter-max-queue-size = 0
# The reporter's flush interval
reporter-flush-interval = 10s
# Whether the reporter should also log the spans
reporter-log-spans = false
# HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces
collector-addr =
# Username to send as part of "Basic" authentication to the collector endpoint
collector-user =
# Password to send as part of "Basic" authentication to the collector endpoint
collector-password =
# UDP address of the agent to send spans to. (only used if collector-addr is empty)
agent-addr = jaeger:6831

## metric data storage in cassandra ##
[cassandra]
Expand Down
46 changes: 40 additions & 6 deletions docker/docker-cluster-query/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and lower (read right to left: to the left is lower). panic|fatal|error|warning|info|debug
log-level = info

# enable/disable distributed opentracing via jaeger
tracing-enabled = true
# address of the jaeger agent to send data to
tracing-addr = jaeger:6831
# tracer/process-level tags to include, specified as comma-separated key:value pairs
tracing-add-tags =
## request tracing via jaeger ##
[jaeger]
# Whether the tracer is enabled or not
enabled = true
# A comma separated list of name = value tracer level tags, which get added to all reported spans.
# The value can also refer to an environment variable using the format ${envVarName:default},
# where the :default is optional, and identifies a value to be used if the environment variable cannot be found
add-tags =
# the type of the sampler: const, probabilistic, rateLimiting, or remote
sampler-type = const
# The sampler parameter (number)
# - for "const" sampler, 0 or 1 for always false/true respectively
# - for "probabilistic" sampler, a probability between 0 and 1
# - for "rateLimiting" sampler, the number of spans per second
# - for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership.
sampler-param = 1
# The HTTP endpoint when using the remote sampler
sampler-manager-addr = "http://jaeger:5778/sampling"
# The maximum number of operations that the sampler will keep track of.
# If an operation is not tracked, a default probabilistic
# sampler will be used rather than the per operation specific sampler.
sampler-max-operations = 0
# How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy
sampler-refresh-interval = 10s
# The reporter's maximum queue size
reporter-max-queue-size = 0
# The reporter's flush interval
reporter-flush-interval = 10s
# Whether the reporter should also log the spans
reporter-log-spans = false
# HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces
collector-addr =
# Username to send as part of "Basic" authentication to the collector endpoint
collector-user =
# Password to send as part of "Basic" authentication to the collector endpoint
collector-password =
# UDP address of the agent to send spans to. (only used if collector-addr is empty)
agent-addr = jaeger:6831

## metric data storage in cassandra ##
[cassandra]
Expand Down
46 changes: 40 additions & 6 deletions docker/docker-cluster/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and lower (read right to left: to the left is lower). panic|fatal|error|warning|info|debug
log-level = info

# enable/disable distributed opentracing via jaeger
tracing-enabled = true
# address of the jaeger agent to send data to
tracing-addr = jaeger:6831
# tracer/process-level tags to include, specified as comma-separated key:value pairs
tracing-add-tags =
## request tracing via jaeger ##
[jaeger]
# Whether the tracer is enabled or not
enabled = true
# A comma separated list of name = value tracer level tags, which get added to all reported spans.
# The value can also refer to an environment variable using the format ${envVarName:default},
# where the :default is optional, and identifies a value to be used if the environment variable cannot be found
add-tags =
# the type of the sampler: const, probabilistic, rateLimiting, or remote
sampler-type = const
# The sampler parameter (number)
# - for "const" sampler, 0 or 1 for always false/true respectively
# - for "probabilistic" sampler, a probability between 0 and 1
# - for "rateLimiting" sampler, the number of spans per second
# - for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership.
sampler-param = 1
# The HTTP endpoint when using the remote sampler
sampler-manager-addr = "http://jaeger:5778/sampling"
# The maximum number of operations that the sampler will keep track of.
# If an operation is not tracked, a default probabilistic
# sampler will be used rather than the per operation specific sampler.
sampler-max-operations = 0
# How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy
sampler-refresh-interval = 10s
# The reporter's maximum queue size
reporter-max-queue-size = 0
# The reporter's flush interval
reporter-flush-interval = 10s
# Whether the reporter should also log the spans
reporter-log-spans = false
# HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces
collector-addr =
# Username to send as part of "Basic" authentication to the collector endpoint
collector-user =
# Password to send as part of "Basic" authentication to the collector endpoint
collector-password =
# UDP address of the agent to send spans to. (only used if collector-addr is empty)
agent-addr = jaeger:6831

## metric data storage in cassandra ##
[cassandra]
Expand Down
46 changes: 40 additions & 6 deletions docker/docker-dev-custom-cfg-kafka/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and lower (read right to left: to the left is lower). panic|fatal|error|warning|info|debug
log-level = info

# enable/disable distributed opentracing via jaeger
tracing-enabled = true
# address of the jaeger agent to send data to
tracing-addr = jaeger:6831
# tracer/process-level tags to include, specified as comma-separated key:value pairs
tracing-add-tags =
## request tracing via jaeger ##
[jaeger]
# Whether the tracer is enabled or not
enabled = true
# A comma separated list of name = value tracer level tags, which get added to all reported spans.
# The value can also refer to an environment variable using the format ${envVarName:default},
# where the :default is optional, and identifies a value to be used if the environment variable cannot be found
add-tags =
# the type of the sampler: const, probabilistic, rateLimiting, or remote
sampler-type = const
# The sampler parameter (number)
# - for "const" sampler, 0 or 1 for always false/true respectively
# - for "probabilistic" sampler, a probability between 0 and 1
# - for "rateLimiting" sampler, the number of spans per second
# - for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership.
sampler-param = 1
# The HTTP endpoint when using the remote sampler
sampler-manager-addr = "http://jaeger:5778/sampling"
# The maximum number of operations that the sampler will keep track of.
# If an operation is not tracked, a default probabilistic
# sampler will be used rather than the per operation specific sampler.
sampler-max-operations = 0
# How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy
sampler-refresh-interval = 10s
# The reporter's maximum queue size
reporter-max-queue-size = 0
# The reporter's flush interval
reporter-flush-interval = 10s
# Whether the reporter should also log the spans
reporter-log-spans = false
# HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces
collector-addr =
# Username to send as part of "Basic" authentication to the collector endpoint
collector-user =
# Password to send as part of "Basic" authentication to the collector endpoint
collector-password =
# UDP address of the agent to send spans to. (only used if collector-addr is empty)
agent-addr = jaeger:6831

## metric data storage in cassandra ##
[cassandra]
Expand Down
Loading