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 all commits
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/blob/main/README.md#compatibility)
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, Java, or Ruby, and
`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
45 changes: 45 additions & 0 deletions content/en/docs/languages/ruby/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ end

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

#### Overriding configuration for specific instrumentation libraries with environment variables

You can also disable specific instrumentation libraries using environment
variables. An instrumentation disabled by an environment variable takes
precedence over local config. The convention for environment variable names is
the library name, upcased with `::` replaced by underscores, `OPENTELEMETRY`
shortened to `OTEL_LANG`, and `_ENABLED` appended.

For example, the environment variable name for
`OpenTelemetry::Instrumentation::Sinatra` is
`OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED`.

```bash
export OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED=false
```

### Configuring specific instrumentation libraries

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

#### Configuring specific instrumentation libraries with environment variables

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, upcased with `::` replaced by underscores,
`OPENTELEMETRY` shortened to `OTEL_{LANG}`, and `_CONFIG_OPTS` appended.

For example, the environment variable name for
`OpenTelemetry::Instrumentation::Faraday` is
`OTEL_RUBY_INSTRUMENTATION_FARADAY_CONFIG_OPTS`. A value of
`peer_service=new_service;span_kind=client` overrides the options set from
[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
The following table lists the acceptable format for values according to the
option data type:

| Data Type | Value | Example |
| --------- | -------------------------- | ---------------- |
| Array | string with `,` separation | `option=a,b,c,d` |
| Boolean | true/false | `option=true` |
| Integer | string | `option=string` |
| String | string | `option=string` |
| Enum | string | `option=string` |
tiffany76 marked this conversation as resolved.
Show resolved Hide resolved
| Callable | not allowed | N\A |

### 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 @@ -8435,6 +8435,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