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

Commit

Permalink
jaeger config & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Aug 10, 2017
1 parent c88cd8c commit d7ef432
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 3 deletions.
5 changes: 3 additions & 2 deletions conf/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ import (
jaegerlog "github.com/uber/jaeger-client-go/log"
)

func GetTracer() (opentracing.Tracer, io.Closer, error) {
func GetTracer(enabled bool, addr string) (opentracing.Tracer, io.Closer, error) {
// Sample configuration for testing. Use constant sampling to sample every trace
// and enable LogSpan to log every span via configured Logger.
cfg := jaegercfg.Configuration{
Disabled: !enabled,
Sampler: &jaegercfg.SamplerConfig{
Type: jaeger.SamplerTypeConst,
Param: 1,
},
Reporter: &jaegercfg.ReporterConfig{
LogSpans: true,
LocalAgentHostPort: "jaeger:6831",
LocalAgentHostPort: addr,
},
}

Expand Down
5 changes: 5 additions & 0 deletions docker/docker-cluster/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2

# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831

## Retention settings ##
[retention]
# path to storage-schemas.conf file
Expand Down
5 changes: 5 additions & 0 deletions docker/docker-dev-custom-cfg-kafka/metrictank.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2

# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831

## Retention settings ##
[retention]
# path to storage-schemas.conf file
Expand Down
4 changes: 4 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ proftrigger-min-diff = 1h
proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2
# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831
```

## Retention settings ##
Expand Down
6 changes: 6 additions & 0 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,9 @@ For more information on profiling see the excellent [Profiling Go Programs](http
* can use debug logging to trace data throughout the pipeline. mt-store-cat to see what's in cassandra, mt-kafka-mdm-sniff, etc.
* if it's old data, make sure you have a primary that can save data to cassandra, that the write queue can drain
* check `metric-max-stale` and `chunk-max-stale` settings, make sure chunks are not being prematurely sealed (happens in some rare cases if you send data very infrequently. see `tank.add_to_closed_chunk` metric)

## Opentracing

Metrictank supports opentracing via [Jaeger](http://jaeger.readthedocs.io/en/latest/)
It can give good insights into why certain requests are slow, and is easy to run.
To use, enable in the config and point it at a Jaeger collector.
5 changes: 5 additions & 0 deletions metrictank-sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2

# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831

## Retention settings ##
[retention]
# path to storage-schemas.conf file
Expand Down
5 changes: 4 additions & 1 deletion metrictank.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ 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")
)

func init() {
Expand Down Expand Up @@ -315,7 +318,7 @@ func main() {
/***********************************
Initialize tracer
***********************************/
tracer, traceCloser, err := conf.GetTracer()
tracer, traceCloser, err := conf.GetTracer(*tracingEnabled, *tracingAddr)
if err != nil {
log.Fatal(4, "Could not initialize jaeger tracer: %s", err.Error())
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/config/metrictank-docker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2

# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831

## Retention settings ##
[retention]
# path to storage-schemas.conf file
Expand Down
5 changes: 5 additions & 0 deletions scripts/config/metrictank-package.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ proftrigger-heap-thresh = 25000000000
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
log-level = 2

# enable/disable distributed opentracing via jaeger
tracing-enabled = false
# address of the jaeger agent to send data to
tracing-addr = localhost:6831

## Retention settings ##
[retention]
# path to storage-schemas.conf file
Expand Down

0 comments on commit d7ef432

Please sign in to comment.