Skip to content

Commit

Permalink
describe how to disable spring boot starter / use sys property widget…
Browse files Browse the repository at this point in the history
… everywhere (#3851)

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
  • Loading branch information
3 people authored Jan 27, 2024
1 parent 80ca5f3 commit 530e07d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
4 changes: 2 additions & 2 deletions content/en/docs/languages/java/automatic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ and JVMs][support].

## Troubleshooting

You can pass the `-Dotel.javaagent.debug=true` parameter to the agent to see
debug logs. Note that these are quite verbose.
{{% config_option name="otel.javaagent.debug" %}} Set to `true` to see debug
logs. Note that these are quite verbose. {{% /config_option %}}

## Next steps

Expand Down
28 changes: 15 additions & 13 deletions content/en/docs/languages/java/automatic/agent-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,23 @@ span link connecting it to the producer trace.

### Disabling the agent entirely

You can disable the agent using `-Dotel.javaagent.enabled=false` (or using the
equivalent environment variable `OTEL_JAVAAGENT_ENABLED=false`).
{{% config_option name="otel.javaagent.enabled" %}}

Set the value to `false` to disable the agent entirely.

{{% /config_option %}}

### Enable only specific instrumentation

You can disable all default auto instrumentation and selectively re-enable
individual instrumentation. This may be desirable to reduce startup overhead or
to have more control of which instrumentation is applied.

- Disable all instrumentation in the agent using
`-Dotel.instrumentation.common.default-enabled=false` (or using the equivalent
environment variable `OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED=false`).
- Enable each desired instrumentation individually using
`-Dotel.instrumentation.[name].enabled=true` (or using the equivalent
environment variable `OTEL_INSTRUMENTATION_[NAME]_ENABLED`) where `[name]`
(`[NAME]`) is the corresponding instrumentation `name` below.
{{% config_option name="otel.instrumentation.common.default-enabled" %}} Set to
`false` to disable all instrumentation in the agent. {{% /config_option %}}

{{% config_option name="otel.instrumentation.[name].enabled" %}} Set to `true`
to enable each desired instrumentation individually. {{% /config_option %}}

> **Note**: Some instrumentation relies on other instrumentation to function
> properly. When selectively enabling instrumentation, be sure to enable the
Expand All @@ -261,10 +262,11 @@ instrumentation with `@WithSpan` and normal API interactions by using

### Suppressing specific agent instrumentation

You can suppress agent instrumentation of specific libraries by using
`-Dotel.instrumentation.[name].enabled=false` (or using the equivalent
environment variable `OTEL_INSTRUMENTATION_[NAME]_ENABLED`) where `name`
(`NAME`) is the corresponding instrumentation `name`:
You can suppress agent instrumentation of specific libraries.

{{% config_option name="otel.instrumentation.[name].enabled" %}} Set to `false`
to suppress agent instrumentation of specific libraries, where [name] is the
corresponding instrumentation name: {{% /config_option %}}

| Library/Framework | Instrumentation name |
| ------------------------------------------------ | ------------------------------------------- |
Expand Down
8 changes: 8 additions & 0 deletions content/en/docs/languages/java/automatic/spring-boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ dependencies {

{{% /tab %}} {{< /tabpane>}}

#### Disable data export

{{% config_option name="otel.sdk.disabled" %}}

Set the value to `true` to disable data export, e.g. for testing purposes.

{{% /config_option %}}

### Additional instrumentations

#### JDBC Instrumentation
Expand Down

0 comments on commit 530e07d

Please sign in to comment.