Skip to content

Commit

Permalink
Fix: Remove hardcoded sampling-strategies.json dependency in Jaeger a…
Browse files Browse the repository at this point in the history
…ll-in-one binary

Signed-off-by: yunmaoQu <[email protected]>
  • Loading branch information
yunmaoQu committed Dec 13, 2024
1 parent e98f7f5 commit 29c1ab5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
9 changes: 3 additions & 6 deletions cmd/jaeger/internal/all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ extensions:
max_traces: 100000

remote_sampling:
# We can either use file or adaptive sampling strategy in remote_sampling
file:
path: ./cmd/jaeger/sampling-strategies.json
# adaptive:
# sampling_store: some_store
# initial_sampling_probability: 0.1
adaptive:
sampling_store: some_store
initial_sampling_probability: 0.1
http:
endpoint: "${env:JAEGER_LISTEN_HOST:-localhost}:5778"
grpc:
Expand Down
9 changes: 9 additions & 0 deletions cmd/jaeger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package main

import (
"log"
"os"

"github.com/spf13/viper"

Expand All @@ -24,6 +25,14 @@ func main() {
command,
)

if err := command.Execute(); err != nil {
log.Fatal(err)
}
strategiesFile := "./cmd/jaeger/sampling-strategies.json"
if _, err := os.Stat(strategiesFile); os.IsNotExist(err) {
log.Printf("Warning: Sampling strategies file not found at %s. Running with default configuration.\n", strategiesFile)
}

if err := command.Execute(); err != nil {
log.Fatal(err)
}
Expand Down
18 changes: 0 additions & 18 deletions cmd/jaeger/sampling-strategies.json

This file was deleted.

0 comments on commit 29c1ab5

Please sign in to comment.