Skip to content

Commit

Permalink
chore(tracing): rename cli key (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 authored Sep 18, 2024
1 parent ad3a81f commit 9820efc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions tracing/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ func FromCLIContext(c *cli.Context) (*Client, error) {
},
}

// read per-endpoint configurations from file
endpointsConfigPath := c.String("tracing.sampler.endpoints")
if len(endpointsConfigPath) > 0 {
f, err := os.ReadFile(endpointsConfigPath)
// read per-task configurations from file
tasksConfigPath := c.String("tracing.sampler.tasks")
if len(tasksConfigPath) > 0 {
f, err := os.ReadFile(tasksConfigPath)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("unable to read tracing endpoints config file from path %s", endpointsConfigPath))
return nil, errors.Wrap(err, fmt.Sprintf("unable to read tracing tasks config file from path %s", tasksConfigPath))
}

err = json.Unmarshal(f, &cfg.Sampler.Tasks)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("unable to parse tracing endpoints config file from path %s", endpointsConfigPath))
return nil, errors.Wrap(err, fmt.Sprintf("unable to parse tracing tasks config file from path %s", tasksConfigPath))
}
}

Expand Down
2 changes: 1 addition & 1 deletion tracing/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var Flags = []cli.Flag{

&cli.StringFlag{
EnvVars: []string{"VELA_OTEL_TRACING_SAMPLER_TASKS_CONFIG_FILEPATH"},
Name: "tracing.sampler.endpoints",
Name: "tracing.sampler.tasks",
Usage: "set an (optional) filepath to the otel tracing head-sampler configurations json to alter how certain tasks (endpoints, queries, etc) are sampled. when no path is provided all tasks are recorded using default parameters. see: https://opentelemetry.io/docs/concepts/sampling/",
},
}

0 comments on commit 9820efc

Please sign in to comment.