Skip to content

Commit 87872de

Browse files
authored
Update CONFIGURATION.md
1 parent 9946d0c commit 87872de

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

CONFIGURATION.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -77,55 +77,22 @@ ruby application.rb
7777

7878
### Instrumentation Environment Variables
7979

80-
You can use OpenTelemetry Ruby instrumentation environment variables to disable certain instrumentation.
81-
From [instrumentation-base](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/opentelemetry-instrumentation-base/v0.22.3/instrumentation/base/lib/opentelemetry/instrumentation/base.rb#L56-L61):
82-
> The instrumention class establishes a convention for disabling an instrumentation
83-
> by environment variable and local configuration. An instrumentation disabled
84-
> by environment variable will take precedence over local config. The
85-
> convention for environment variable name is the library name, upcased with
86-
> '::' replaced by underscores, OPENTELEMETRY shortened to OTEL_{LANG}, and '_ENABLED' appended.
87-
> For example: OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED = false.
80+
You can use OpenTelemetry Ruby instrumentation environment variables to [disable](https://opentelemetry.io/docs/languages/ruby/libraries/#overriding-configuration-for-specific-instrumentation-libraries-with-environment-variables) or [configure](https://opentelemetry.io/docs/languages/ruby/libraries/#configuring-specific-instrumentation-libraries-with-environment-variables) certain instrumentation, see the [OpenTelemetry Docs](https://opentelemetry.io/docs/languages/ruby/libraries/#use-instrumentation-libraries) for details.
8881

89-
For example to disable sinatra instrumentation, you can set `OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED` to false through
82+
For example, to disable sinatra instrumentation and disable mysql2 instrumentation's obfuscation of db.statement:
9083

9184
```bash
9285
export OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED=false
93-
```
94-
95-
or in your initialization step
96-
97-
```ruby
98-
ENV['OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED']='false'
99-
```
100-
101-
Options setup through enviromental variables
102-
103-
> Checks to see if user pass any environment variable that set option for instrumentation.
104-
> By convention, the environment variable will be the instrumentation name upper cased,
105-
> with '::' replaced by underscores, OPENTELEMETRY shortened to OTEL_{LANG} and_CONFIG_OPTS appended.
106-
> For example, the, environment variable name for OpenTelemetry::Instrumentation::Faraday
107-
> will be OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS. A value of 'peer_service=new_service;'
108-
> will overrides the option set from ::OpenTelemetry::SDK.configure do |c| ... end for faraday.
109-
>
110-
> For array option, simply separate the value by , (e.g. option=a,b,c,d).
111-
> For boolean option, set value by true or false (e.g. option=true).
112-
> For integer, string, enum, set value by string (e.g. option=string).
113-
> Callable option is not allowed to set through environment variable.
114-
115-
For example, to disable db.statement obfuscation in mysql2 instrumentation, set `OTEL_RUBY_INSTRUMENTATION_MYSQL2_CONFIG_OPTS` through
116-
117-
```bash
11886
export OTEL_RUBY_INSTRUMENTATION_MYSQL2_CONFIG_OPTS='db_statement=include;'
11987
```
12088

121-
or in your initialization step
89+
or in your initialization step:
12290

12391
```ruby
92+
ENV['OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED'] = 'false'
12493
ENV['OTEL_RUBY_INSTRUMENTATION_MYSQL2_CONFIG_OPTS'] = 'db_statement=include;'
12594
```
12695

127-
See more details in [instrumentation-base](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/opentelemetry-instrumentation-base/v0.22.3/instrumentation/base/lib/opentelemetry/instrumentation/base.rb#L56-L61)
128-
12996
## Configuration File
13097

13198
On startup, the library looks for the configuration file in the following locations under the application's current working directory:

0 commit comments

Comments
 (0)