Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tracegen] Add service name as a command line option #2080

Merged
merged 1 commit into from
Feb 20, 2020
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
2 changes: 1 addition & 1 deletion cmd/tracegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {

metricsFactory := prometheus.New()
traceCfg := &jaegerConfig.Configuration{
ServiceName: "tracegen",
ServiceName: cfg.Service,
Sampler: &jaegerConfig.SamplerConfig{
Type: "const",
Param: 1,
Expand Down
2 changes: 2 additions & 0 deletions internal/tracegen/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Config struct {
Firehose bool
Pause time.Duration
Duration time.Duration
Service string
}

// Flags registers config flags.
Expand All @@ -44,6 +45,7 @@ func (c *Config) Flags(fs *flag.FlagSet) {
fs.BoolVar(&c.Firehose, "firehose", false, "Whether to set FIREHOSE flag on the spans to skip indexing")
fs.DurationVar(&c.Pause, "pause", time.Microsecond, "How long to pause before finishing trace")
fs.DurationVar(&c.Duration, "duration", 0, "For how long to run the test")
fs.StringVar(&c.Service, "service", "tracegen", "Service name to use")
}

// Run executes the test scenario.
Expand Down