jaegertracing / documentation

Documentation/website for the Jaeger Distributed Tracing project.
https://jaegertracing.io/
Apache License 2.0
65 stars 156 forks source link

Clarify configuring sampling in the collector #123

Open yurishkuro opened 5 years ago

yurishkuro commented 5 years ago

https://www.jaegertracing.io/docs/sampling/

(a) change "Collector Sampling Configuration" section title to "Collector Configuration", looks better in the TOC in the right sidebar

(b) explain mounting config file for Docker. From gitter

maniaabdi @maniaabdi 16:19
Hello everyone, how should we specify sampling strategies to jaeger-collector. I am using the following command
sudo docker run --rm -p14268:14268 -p9411:9411 -p14267:14267 -e CASSANDRA_SERVERS=192.168.100.15 -e CASSANDRA_PORT=9042 jaegertracing/jaeger-collector --sampling.strategies-file=/home/ubuntu/strategies.json
and I keep getting
{"level":"fatal","ts":1534364309.442946,"caller":"collector/main.go:228","msg":"Failed to create sampling strategy store","error":"Failed to open strategies file: open /home/ubuntu/strategies.json: no such file or directory","errorVerbose":"open /home/ubuntu/strategies.json: no such file or directory\nFailed to open strategies
but I am sure that my file exist
any help is really appreciated

Won Jun Jang @black-adder 16:26
https://stackoverflow.com/questions/41092587/passing-file-as-argument-to-docker-container
you have to pass the file to the container as a volume

Prithvi Raj @vprithvi 16:26
(because the file isn't in the container)

Won Jun Jang @black-adder 16:26
-v /home/ubuntu/strategies.json:/home/ubuntu/strategies.json should work
FYfirst commented 4 years ago

I used "nohup ./jaeger-collector --sampling.strategies-file=./strategies.json --es.server-urls http://127.0.0.1:9200/ --log-level=debug > collector.log 2>&1 &",it worked but no effective. Then,Running the test file strategy_store_test.go,I can see it loaded the sample configuration and I changed the sample.type to remote,it didn't work.

`cfg := jaegerCfg.Configuration{`
       `Sampler: &jaegerCfg.SamplerConfig{`
        `Type: "remote",`
    `},`
   ` Reporter: &jaegerCfg.ReporterConfig{`
       ` LogSpans: true,`
       ` BufferFlushInterval: 1 * time.Second,`
       ` LocalAgentHostPort: "127.0.0.1:6831",`
    `},`
}`

I created a tracer like this,is right?It can't read the param from collector,can u tell me what should I do. There is my strategies.json file.

{
  "service_strategies": [
    {
      "service": "ContextMakeHappyEnding",
      "type": "probabilistic",
      "param": 1,
      "operation_strategies": [
        {
          "operation": "transporter",
          "type": "probabilistic",
          "param": 0.2
        },
        {
          "operation": "op2",
          "type": "probabilistic",
          "param": 0.4
        }
      ]
    },
    {
      "service": "ContextUnpackKafkaItem",
      "type": "probabilistic",
      "param": 1
    }
  ],
  "default_strategy": [
    {
    "type": "probabilistic",
    "param": 1
    },
    {
      "service": "ContextUnpackKafkaItem",
      "type": "probabilistic",
      "param": 1
    }
  ]
}