diff --git a/content/en/tracing/trace_collection/dynamic_instrumentation/enabling/ruby.md b/content/en/tracing/trace_collection/dynamic_instrumentation/enabling/ruby.md index 02905048258..98adad4f285 100644 --- a/content/en/tracing/trace_collection/dynamic_instrumentation/enabling/ruby.md +++ b/content/en/tracing/trace_collection/dynamic_instrumentation/enabling/ruby.md @@ -31,6 +31,7 @@ Before you begin, review the [Dynamic Instrumentation prerequisites][12]. Ruby a 1. If you don't already have APM enabled, in your Agent configuration, set the `DD_APM_ENABLED` environment variable to `true` and listening to the port `8126/TCP`. 2. Run your service with Dynamic Instrumentation enabled by setting the `DD_DYNAMIC_INSTRUMENTATION_ENABLED` environment variable to `true`. Specify `DD_SERVICE`, `DD_ENV`, and `DD_VERSION` Unified Service Tags so you can filter and group your instrumentations and target active clients across these dimensions. 3. After starting your service with Dynamic Instrumentation enabled, you can start using Dynamic Instrumentation on the [APM > Dynamic Instrumentation page][3]. +4. For a better experience, Dynamic Instrumentation automatically enables [autocomplete and search (in Preview)][14]. **Note**: Dynamic Instrumentation initializes when the application processes its first HTTP request. Ensure your application receives at least one request after startup before creating probes. @@ -124,3 +125,4 @@ The following features available in other languages are not supported for Ruby: [11]: /dynamic_instrumentation/expression-language/ [12]: /dynamic_instrumentation/#prerequisites [13]: https://github.com/DataDog/dd-trace-rb +[14]: /dynamic_instrumentation/symdb/ diff --git a/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/_index.md b/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/_index.md index 73128314f4b..f90575d31b0 100644 --- a/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/_index.md +++ b/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/_index.md @@ -14,7 +14,7 @@ site_support_id: autocomplete_search --- {{< beta-callout url="#" btn_hidden="true" >}} -Autocomplete and search are in Preview for Python and .NET. +Autocomplete and search are in Preview for Python, .NET, and Ruby. {{< /beta-callout >}} ## Overview @@ -43,6 +43,7 @@ Select your runtime below: {{< image-card href="/dynamic_instrumentation/symdb/python" src="integrations_logos/python.png" alt="Python" >}} {{< image-card href="/dynamic_instrumentation/symdb/dotnet" src="integrations_logos/dotnet-core.png" alt="Dotnet" >}} {{< image-card href="/dynamic_instrumentation/symdb/dotnet" src="integrations_logos/dotnet-framework.png" alt="Dotnet" >}} + {{< image-card href="/dynamic_instrumentation/symdb/ruby" src="integrations_logos/ruby.png" alt="Ruby" >}} {{< /card-grid >}} ## Explore autocomplete and search diff --git a/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/ruby.md b/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/ruby.md new file mode 100644 index 00000000000..d93bace19a2 --- /dev/null +++ b/content/en/tracing/trace_collection/dynamic_instrumentation/symdb/ruby.md @@ -0,0 +1,58 @@ +--- +title: Enable Autocomplete and Search for Ruby +description: Configure Ruby applications to enable IDE-like autocomplete and search features for Dynamic Instrumentation. +is_beta: true +private: false +code_lang: ruby +type: multi-code-lang +code_lang_weight: 60 +aliases: + - /dynamic_instrumentation/symdb/ruby + - /tracing/dynamic_instrumentation/symdb/ruby +--- +{{< beta-callout url="#" btn_hidden="true" >}} +Autocomplete and search are in Preview. +{{< /beta-callout >}} + +## Requirements + +- [Dynamic Instrumentation][1] is enabled for your service. +- Tracing library [`dd-trace-rb`][6] 2.37.0 or higher is installed. +- Ruby 2.7 or higher. On Ruby 2.6, parameter names are not available for autocomplete because the runtime does not expose them. + +## Installation + +Autocomplete and search are enabled automatically when you run your service with Dynamic Instrumentation enabled: + +1. Run your service with Dynamic Instrumentation enabled by setting the `DD_DYNAMIC_INSTRUMENTATION_ENABLED` environment variable to `true`. +2. Specify `DD_SERVICE` and `DD_VERSION` [Unified Service Tags][5]. +3. Invoke your service: + + ```shell + export DD_SERVICE= + export DD_ENV= + export DD_VERSION= + export DD_DYNAMIC_INSTRUMENTATION_ENABLED=true + bundle exec rails server + ``` + +After starting your service with Dynamic Instrumentation enabled, you can use Dynamic Instrumentation's IDE-like features on the [**APM** > **Dynamic Instrumentation**][4] page. + +## Additional notes + +### Disabling autocomplete and search + +To disable autocomplete and search for your service, set the `DD_SYMBOL_DATABASE_UPLOAD_ENABLED` environment variable to `false`: + +```shell +export DD_SYMBOL_DATABASE_UPLOAD_ENABLED=false +``` + +### Forking servers + +When your application uses a forking server (Puma in clustered mode, Unicorn, Passenger), each worker process uploads its own symbol set after the fork. Workers that load additional code after forking continue to upload incrementally as new classes are loaded. + +[1]: /dynamic_instrumentation +[4]: https://app.datadoghq.com/dynamic-instrumentation +[5]: /getting_started/tagging/unified_service_tagging +[6]: https://github.com/DataDog/dd-trace-rb