Skip to content

Commit bd78b16

Browse files
xuan-cao-switiffany76kaylareopellecartermp
authored
adding updated doc ruby lambda and environment variables for ruby lib… (#4904)
Co-authored-by: Tiffany Hrabusa <[email protected]> Co-authored-by: Kayla Reopelle <[email protected]> Co-authored-by: Phillip Carter <[email protected]>
1 parent aa5f568 commit bd78b16

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

content/en/docs/faas/lambda-auto-instrument.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ for the following languages:
1111
- Java
1212
- JavaScript
1313
- Python
14+
- Ruby
1415

1516
These can be added to your Lambda using the AWS portal to automatically
1617
instrument your application. These layers do not include the Collector which is
@@ -80,12 +81,19 @@ information about supported Python versions, see the
8081
[OpenTelemetry Python documentation](https://github.com/open-telemetry/opentelemetry-python/blob/main/README.md#supported-runtimes)
8182
and the package on [PyPi](https://pypi.org/project/opentelemetry-api/).
8283

84+
{{% /tab %}} {{% tab Ruby %}}
85+
86+
The Lambda layer supports Ruby 3.2 and 3.3 Lambda runtimes. For more information
87+
about supported OpenTelemetry Ruby SDK and API versions, see the
88+
[OpenTelemetry Ruby documentation](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/README.md#compatibility)
89+
and the package on [RubyGem](https://rubygems.org/search?query=opentelemetry).
90+
8391
{{% /tab %}} {{< /tabpane >}}
8492

8593
### Configure `AWS_LAMBDA_EXEC_WRAPPER`
8694

8795
Change the entry point of your application by setting
88-
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler` for Node.js or Java, and
96+
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler` for Node.js, Java, or Ruby, and
8997
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument` for Python. These wrapper scripts
9098
will invoke your Lambda application with the automatic instrumentation applied.
9199

@@ -131,6 +139,11 @@ uses the protocol `http/protobuf`
131139
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` supports: `http/protobuf` and
132140
`http/json` `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`
133141

142+
{{% /tab %}} {{% tab Ruby %}}
143+
144+
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` supports: `http/protobuf`
145+
`OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`
146+
134147
{{% /tab %}} {{< /tabpane >}}
135148

136149
### Publish your Lambda

content/en/docs/languages/ruby/libraries.md

+45
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ end
7272

7373
To override more instrumentation, add another entry in the `config` map.
7474

75+
#### Overriding configuration for specific instrumentation libraries with environment variables
76+
77+
You can also disable specific instrumentation libraries using environment
78+
variables. An instrumentation disabled by an environment variable takes
79+
precedence over local config. The convention for environment variable names is
80+
the library name, upcased with `::` replaced by underscores, `OPENTELEMETRY`
81+
shortened to `OTEL_LANG`, and `_ENABLED` appended.
82+
83+
For example, the environment variable name for
84+
`OpenTelemetry::Instrumentation::Sinatra` is
85+
`OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED`.
86+
87+
```bash
88+
export OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED=false
89+
```
90+
7591
### Configuring specific instrumentation libraries
7692

7793
If you prefer more selectively installing and using only specific
@@ -98,6 +114,35 @@ OpenTelemetry::SDK.configure do |c|
98114
end
99115
```
100116

117+
#### Configuring specific instrumentation libraries with environment variables
118+
119+
You can also define the option for specific instrumentation libraries using
120+
environment variables. By convention, the environment variable will be the name
121+
of the instrumentation, upcased with `::` replaced by underscores,
122+
`OPENTELEMETRY` shortened to `OTEL_{LANG}`, and `_CONFIG_OPTS` appended.
123+
124+
For example, the environment variable name for
125+
`OpenTelemetry::Instrumentation::Faraday` is
126+
`OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS`. A value of
127+
`peer_service=new_service;span_kind=client` overrides the options set from
128+
[previous section](#configuring-specific-instrumentation-libraries) for Faraday.
129+
130+
```bash
131+
export OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS="peer_service=new_service;span_kind=client"
132+
```
133+
134+
The following table lists the acceptable format for values according to the
135+
option data type:
136+
137+
| Data Type | Value | Example |
138+
| --------- | -------------------------- | ---------------- |
139+
| Array | string with `,` separation | `option=a,b,c,d` |
140+
| Boolean | true/false | `option=true` |
141+
| Integer | string | `option=string` |
142+
| String | string | `option=string` |
143+
| Enum | string | `option=string` |
144+
| Callable | not allowed | N\A |
145+
101146
### Next steps
102147

103148
Instrumentation libraries are the easiest way to generate lots of useful

static/refcache.json

+4
Original file line numberDiff line numberDiff line change
@@ -8435,6 +8435,10 @@
84358435
"StatusCode": 200,
84368436
"LastSeen": "2024-01-22T15:38:55.347099+01:00"
84378437
},
8438+
"https://rubygems.org/search": {
8439+
"StatusCode": 200,
8440+
"LastSeen": "2024-07-29T12:09:34.887196-04:00"
8441+
},
84388442
"https://rubyonrails.org/": {
84398443
"StatusCode": 206,
84408444
"LastSeen": "2024-01-30T06:01:26.488265-05:00"

0 commit comments

Comments
 (0)