diff --git a/content/en/docs/faas/lambda-auto-instrument.md b/content/en/docs/faas/lambda-auto-instrument.md index 732d26243da7..26a1733fb8f9 100644 --- a/content/en/docs/faas/lambda-auto-instrument.md +++ b/content/en/docs/faas/lambda-auto-instrument.md @@ -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 @@ -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. @@ -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 diff --git a/content/en/docs/languages/ruby/libraries.md b/content/en/docs/languages/ruby/libraries.md index 3c86db788120..136d617e5e27 100644 --- a/content/en/docs/languages/ruby/libraries.md +++ b/content/en/docs/languages/ruby/libraries.md @@ -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 @@ -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" +``` + +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` | +| Callable | not allowed | N\A | + ### Next steps Instrumentation libraries are the easiest way to generate lots of useful diff --git a/static/refcache.json b/static/refcache.json index 64fe532b55e2..a38a50101d99 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -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"