Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding updated doc ruby lambda and environment variables for ruby lib… #4904

Merged
merged 20 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fce678d
adding updated doc ruby lambda and environment variables for ruby lib…
xuan-cao-swi Jul 29, 2024
3e4ac41
Update content/en/docs/faas/lambda-auto-instrument.md
xuan-cao-swi Jul 30, 2024
6310af0
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Jul 30, 2024
df6311c
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Jul 30, 2024
3677bb1
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Jul 30, 2024
1900329
revision
xuan-cao-swi Jul 30, 2024
eea3c36
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Jul 31, 2024
117f2fc
Merge branch 'main' into ruby-env-var-lambda
xuan-cao-swi Jul 31, 2024
1575309
Merge branch 'main' into ruby-env-var-lambda
xuan-cao-swi Jul 31, 2024
25c8857
Update content/en/docs/faas/lambda-auto-instrument.md
xuan-cao-swi Aug 1, 2024
da32f9f
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
ec5446d
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
7128280
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
2691c1e
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
7efca00
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
fe28b8d
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
0285d38
Update content/en/docs/languages/ruby/libraries.md
xuan-cao-swi Aug 1, 2024
6111244
Merge branch 'main' into ruby-env-var-lambda
xuan-cao-swi Aug 1, 2024
37a72aa
lint
xuan-cao-swi Aug 1, 2024
dd2e0c3
Merge branch 'main' into ruby-env-var-lambda
cartermp Aug 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion content/en/docs/faas/lambda-auto-instrument.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ for the following languages:
- Java
- JavaScript
- Python
- Ruby

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

{{% /tab %}} {{% tab Ruby %}}

The Lambda layer supports Ruby 3.2 and 3.3 Lambda runtimes. For more information
about supported OpenTelemetry Ruby SDK and API versions, see the
[OpenTelemetry Ruby documentation](https://github.com/open-telemetry/opentelemetry-ruby)
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
and the package on [RubyGem](https://rubygems.org/search?query=opentelemetry).

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

### Configure `AWS_LAMBDA_EXEC_WRAPPER`

Change the entry point of your application by setting
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler` for Node.js or Java, and
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler` for Node.js or Java or Ruby, and
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
`AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument` for Python. These wrapper scripts
will invoke your Lambda application with the automatic instrumentation applied.

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

{{% /tab %}} {{% tab Ruby %}}

`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` supports: `http/protobuf`
`OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`

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

### Publish your Lambda
Expand Down
39 changes: 39 additions & 0 deletions content/en/docs/languages/ruby/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,45 @@ OpenTelemetry::SDK.configure do |c|
end
```

### Configuring specific instrumentation libraries with environment variable
tiffany76 marked this conversation as resolved.
Show resolved Hide resolved

#### To disable specific instrumentation libraries

If you prefer to disable specific instrumentation libraries more selectively
using environment variables, you can do that too. An instrumentation disabled by
environment variable will take precedence over local config. The convention for
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
environment variable name is the library name, upcased with `::` replaced by
underscores, `OPENTELEMETRY` shortened to `OTEL_LANG`, and `_ENABLED` appended.

For example:

```bash
export OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED=false
```

#### To configure specific instrumentation libraries

You can also define the option for specific instrumentation libraries using
environment variables. By convention, the environment variable will be the name
of the instrumentation, with uppercase, `::` replaced by underscores,
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
`OPENTELEMETRY` shortened to `OTEL_{LANG}`, and `_CONFIG_OPTS` appended.

For example, the environment variable name for
OpenTelemetry::Instrumentation::Faraday will be
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
`OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS`. A value of
`peer_service=new_service;span_kind=client` will override the options set from
xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
[previous section](#configuring-specific-instrumentation-libraries) for Faraday.

```bash
export OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS="peer_service=new_service;span_kind=client"
```

xuan-cao-swi marked this conversation as resolved.
Show resolved Hide resolved
For an array option, simply separate the values with commas (e.g.,
option=a,b,c,d).<br> For a boolean option, set the value to true or false (e.g.,
option=true).<br> For integer, string, enum, set the value as a string (e.g.,
option=string).<br> Callable options are not allowed to be set through
environment variables.
tiffany76 marked this conversation as resolved.
Show resolved Hide resolved

### Next steps

Instrumentation libraries are the easiest way to generate lots of useful
Expand Down
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -8291,6 +8291,10 @@
"StatusCode": 200,
"LastSeen": "2024-01-22T15:38:55.347099+01:00"
},
"https://rubygems.org/search": {
"StatusCode": 200,
"LastSeen": "2024-07-29T12:09:34.887196-04:00"
},
"https://rubyonrails.org/": {
"StatusCode": 206,
"LastSeen": "2024-01-30T06:01:26.488265-05:00"
Expand Down