|
| 1 | +--- |
| 2 | +title: Enable Dynamic Instrumentation for Go |
| 3 | +description: Set up Dynamic Instrumentation for Go applications to add probes and capture data without code changes. |
| 4 | +private: false |
| 5 | +code_lang: go |
| 6 | +type: multi-code-lang |
| 7 | +code_lang_weight: 30 |
| 8 | +aliases: |
| 9 | + - /dynamic_instrumentation/enabling/go |
| 10 | +further_reading: |
| 11 | + - link: 'agent' |
| 12 | + tag: 'Documentation' |
| 13 | + text: 'Getting Started with Datadog Agent' |
| 14 | +--- |
| 15 | + |
| 16 | +{{< beta-callout-private url="https://www.datadoghq.com/product-preview/live-debugger/" >}} |
| 17 | + Dynamic Instrumentation for Go is in limited preview, and is not available to all customers. |
| 18 | + Request access to join the waiting list. |
| 19 | + Note that <a href="#limitations">some limitations</a> apply to the preview. |
| 20 | +{{< /beta-callout-private >}} |
| 21 | + |
| 22 | +Dynamic Instrumentation is a feature of supporting Datadog tracing libraries. |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +1. Install or upgrade your Agent to version [7.73.0][6] or higher. |
| 27 | +2. Update Agent configuration to enable Dynamic Instrumentation (note below you'll need to do something similiar for your service as well). |
| 28 | + |
| 29 | +{{< tabs >}} |
| 30 | +{{% tab "Configuration YAML file" %}} |
| 31 | +Update your `system-probe.yaml` file with: |
| 32 | +```yaml |
| 33 | +dynamic_instrumentation: |
| 34 | + enabled: true |
| 35 | +``` |
| 36 | +
|
| 37 | +[101]: /agent/configuration/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file |
| 38 | +{{% /tab %}} |
| 39 | +{{% tab "Environment variable" %}} |
| 40 | +Add the following to your Datadog Agent manifest: |
| 41 | +```yaml |
| 42 | +DD_DYNAMIC_INSTRUMENTATION_ENABLED=true |
| 43 | +``` |
| 44 | + |
| 45 | +{{% /tab %}} |
| 46 | +{{% tab "Helm" %}} |
| 47 | +Add the following to your Helm chart: |
| 48 | +```yaml |
| 49 | +datadog: |
| 50 | + dynamicInstrumentationGo: |
| 51 | + enabled: true |
| 52 | +``` |
| 53 | +
|
| 54 | +{{% /tab %}} |
| 55 | +{{< /tabs >}} |
| 56 | +
|
| 57 | +3. Install or upgrade the Go tracing library to version >=1.74.6 or >=2.2.3, by following the [relevant instructions][2]. |
| 58 | +4. 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. |
| 59 | +5. After starting your service with Dynamic Instrumentation enabled, you can start using Live Debugger on the [APM > Live Debugger page][3]. |
| 60 | + |
| 61 | +## Configuration |
| 62 | + |
| 63 | +Configure Dynamic Instrumentation using the following environment variables: |
| 64 | + |
| 65 | +| Environment variable | Type | Description | |
| 66 | +| ------------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------- | |
| 67 | +| `DD_DYNAMIC_INSTRUMENTATION_ENABLED` | Boolean | Set to `true` to enable Dynamic Instrumentation. | |
| 68 | +| `DD_SERVICE` | String | The [service][5] name, for example, `web-backend`. | |
| 69 | +| `DD_ENV` | String | The [environment][5] name, for example, `production`. | |
| 70 | +| `DD_VERSION` | String | The [version][5] of your service. | |
| 71 | + |
| 72 | +## What to do next |
| 73 | + |
| 74 | +See [Live Debugger][4] for information about adding instrumentations and browsing and indexing the data. |
| 75 | + |
| 76 | +## Limitations |
| 77 | + |
| 78 | +The following limitations apply to the Go implementation: |
| 79 | + |
| 80 | +### Supported features |
| 81 | + |
| 82 | +- [Live Debugger][4] probes for method calls, returns and specific code lines |
| 83 | +- Symbol search for quick probe location selection |
| 84 | +- Capturing variables and return values available at the selected probe location |
| 85 | +- [Sensitive data redaction][7] |
| 86 | +- [Source code integration][8] |
| 87 | + |
| 88 | +### Unsupported features |
| 89 | + |
| 90 | +- Dynamic Instrumenetation log, metrics, spans and span tag probes |
| 91 | +- Log templates and condition expressions |
| 92 | +- PII redaction based on specific classes or types |
| 93 | +- Propagation of additional `DD_TAGS` set on the service to the probe results tags |
| 94 | + |
| 95 | +## Further reading |
| 96 | + |
| 97 | +{{< partial name="whats-next/whats-next.html" >}} |
| 98 | + |
| 99 | +[2]: /tracing/trace_collection/dd_libraries/go/ |
| 100 | +[3]: https://app.datadoghq.com/debugging |
| 101 | +[4]: /tracing/live_debugger/ |
| 102 | +[5]: /getting_started/tagging/unified_service_tagging |
| 103 | +[6]: https://app.datadoghq.com/account/settings/agent/latest?platform=overview |
| 104 | +[7]: /dynamic_instrumentation/sensitive-data-scrubbing/#redact-based-on-variable-values-with-sensitive-data-scanner |
| 105 | +[8]: /integrations/guide/source-code-integration/?tab=go#embed-git-information-in-your-build-artifacts |
0 commit comments