Skip to content

Commit

Permalink
fix typo in exec envvar OTEL_CLI_EXEC_TP_DISABLE_INJECT (#311)
Browse files Browse the repository at this point in the history
* fix typo in OTEL_CLI_EXEC_TP_DISABLE_INJECT + test

* add changelog entry
  • Loading branch information
tobert committed Mar 11, 2024
1 parent b23efba commit 8976732
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [0.4.4] - 2024-03-11

Fix a typo in the `OTEL_CLI_EXEC_TP_DISABLE_INJECT` envvar.

### Changed

- spell `DISALBE` correctly in `OTEL_CLI_EXEC_TP_DISABLE_INJECT`
- adds a test for that

## [0.4.3] - 2024-03-11

Add injection of `{{traceparent}}` to `otel-cli exec` as default behavior, along with
Expand Down
18 changes: 18 additions & 0 deletions data_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,24 @@ var suites = []FixtureSuite{
SpanCount: 1,
},
},
{
Name: "otel-cli exec returns the {{traceparent}} tag unmodified with OTEL_CLI_EXEC_TP_DISABLE_INJECT",
Config: FixtureConfig{
Env: map[string]string{
"OTEL_CLI_EXEC_TP_DISABLE_INJECT": "true",
},
CliArgs: []string{
"exec", "--endpoint", "{{endpoint}}",
"--force-trace-id", "e39280f2980af3a8600ae98c74f2dabf", "--force-span-id", "023eee2731392b4d",
"--",
"echo", "{{traceparent}}"},
},
Expect: Results{
Config: otelcli.DefaultConfig().WithEndpoint("{{endpoint}}"),
CliOutput: "{{traceparent}}\n",
SpanCount: 1,
},
},
},
// validate OTEL_EXPORTER_OTLP_PROTOCOL / --protocol
{
Expand Down
2 changes: 1 addition & 1 deletion otelcli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ type Config struct {
BackgroundSkipParentPidCheck bool `json:"background_skip_parent_pid_check"`

ExecCommandTimeout string `json:"exec_command_timeout" env:"OTEL_CLI_EXEC_CMD_TIMEOUT"`
ExecTpDisableInject bool `json:"exec_tp_disable_inject" env:"OTEL_CLI_EXEC_TP_DISALBE_INJECT"`
ExecTpDisableInject bool `json:"exec_tp_disable_inject" env:"OTEL_CLI_EXEC_TP_DISABLE_INJECT"`

StatusCanaryCount int `json:"status_canary_count"`
StatusCanaryInterval string `json:"status_canary_interval"`
Expand Down

0 comments on commit 8976732

Please sign in to comment.