Skip to content

Commit

Permalink
Add OTEL_SDK_ENABLED environment property
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Baptista <[email protected]>
  • Loading branch information
brunobat committed Jul 21, 2022
1 parent 42081e0 commit 27e70e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ content of "Unreleased" section content will generate release notes for the
release.

## Unreleased
- Add the OTEL_SDK_ENABLED environmental variable to the SDK configuration.
([2679](https://github.com/open-telemetry/opentelemetry-specification/pull/2679))

### Context

Expand Down
3 changes: 3 additions & 0 deletions specification/sdk-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ For example, the value `12000` indicates 12000 milliseconds, i.e., 12 seconds.

| Name | Description | Default | Notes |
| ------------------------ | ------------------------------------------------- | --------------------------------- | ----------------------------------- |
| OTEL_SDK_ENABLED | Activate/deactivate the SDK | true | This deactivates all other properties |
| OTEL_RESOURCE_ATTRIBUTES | Key-value pairs to be used as resource attributes | See [Resource semantic conventions](resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value) for details. | See [Resource SDK](./resource/sdk.md#specifying-resource-information-via-an-environment-variable) for more details. |
| OTEL_SERVICE_NAME | Sets the value of the [`service.name`](./resource/semantic_conventions/README.md#service) resource attribute | | If `service.name` is also provided in `OTEL_RESOURCE_ATTRIBUTES`, then `OTEL_SERVICE_NAME` takes precedence. |
| OTEL_LOG_LEVEL | Log level used by the SDK logger | "info" | |
| OTEL_PROPAGATORS | Propagators to be used as a comma-separated list | "tracecontext,baggage" | Values MUST be deduplicated in order to register a `Propagator` only once. |
| OTEL_TRACES_SAMPLER | Sampler to be used for traces | "parentbased_always_on" | See [Sampling](./trace/sdk.md#sampling) |
| OTEL_TRACES_SAMPLER_ARG | String value to be used as the sampler argument | | The specified value will only be used if OTEL_TRACES_SAMPLER is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input MUST be logged and MUST be otherwise ignored, i.e. the SDK MUST behave as if OTEL_TRACES_SAMPLER_ARG is not set. |

Setting `OTEL_SDK_ENABLED` to `"false"` will configure Noop SDK implementation providers for Tracing, Metrics and Logs. Propagators will also be a Noop implementation (Equivalent to `OTEL_PROPAGATORS` to `"none"`).

Known values for `OTEL_PROPAGATORS` are:

- `"tracecontext"`: [W3C Trace Context](https://www.w3.org/TR/trace-context/)
Expand Down

0 comments on commit 27e70e4

Please sign in to comment.