From 40f112d3a8056b50d19d1100d59d2b3de0a6c1c2 Mon Sep 17 00:00:00 2001 From: Cara Reaume Date: Thu, 2 Jul 2026 16:22:24 -0400 Subject: [PATCH 1/4] first iteration: new child page for each language (incl. 'other'), all containing links to Docker section, new Prerequisites sections --- config/_default/menus/main.en.yaml | 40 ++ content/en/source_code/service-mapping.md | 394 ------------------ .../en/source_code/service-mapping/_index.md | 59 +++ .../en/source_code/service-mapping/dotnet.md | 58 +++ content/en/source_code/service-mapping/go.md | 66 +++ .../en/source_code/service-mapping/java.md | 57 +++ .../en/source_code/service-mapping/nodejs.md | 59 +++ .../en/source_code/service-mapping/other.md | 25 ++ content/en/source_code/service-mapping/php.md | 33 ++ .../en/source_code/service-mapping/python.md | 60 +++ .../en/source_code/service-mapping/ruby.md | 45 ++ layouts/shortcodes/collapse-content.html | 3 +- 12 files changed, 504 insertions(+), 395 deletions(-) delete mode 100644 content/en/source_code/service-mapping.md create mode 100644 content/en/source_code/service-mapping/_index.md create mode 100644 content/en/source_code/service-mapping/dotnet.md create mode 100644 content/en/source_code/service-mapping/go.md create mode 100644 content/en/source_code/service-mapping/java.md create mode 100644 content/en/source_code/service-mapping/nodejs.md create mode 100644 content/en/source_code/service-mapping/other.md create mode 100644 content/en/source_code/service-mapping/php.md create mode 100644 content/en/source_code/service-mapping/python.md create mode 100644 content/en/source_code/service-mapping/ruby.md diff --git a/config/_default/menus/main.en.yaml b/config/_default/menus/main.en.yaml index 562f9c1c464..34b2cac45f4 100644 --- a/config/_default/menus/main.en.yaml +++ b/config/_default/menus/main.en.yaml @@ -6428,6 +6428,46 @@ menu: parent: source_code_integration identifier: sci_service_mapping weight: 2 + - name: Go + url: source_code/service-mapping/go/ + parent: sci_service_mapping + identifier: sci_service_mapping_go + weight: 1 + - name: Python + url: source_code/service-mapping/python/ + parent: sci_service_mapping + identifier: sci_service_mapping_python + weight: 2 + - name: .NET + url: source_code/service-mapping/dotnet/ + parent: sci_service_mapping + identifier: sci_service_mapping_dotnet + weight: 3 + - name: Node.js + url: source_code/service-mapping/nodejs/ + parent: sci_service_mapping + identifier: sci_service_mapping_nodejs + weight: 4 + - name: Ruby + url: source_code/service-mapping/ruby/ + parent: sci_service_mapping + identifier: sci_service_mapping_ruby + weight: 5 + - name: Java + url: source_code/service-mapping/java/ + parent: sci_service_mapping + identifier: sci_service_mapping_java + weight: 6 + - name: PHP + url: source_code/service-mapping/php/ + parent: sci_service_mapping + identifier: sci_service_mapping_php + weight: 7 + - name: Other Languages + url: source_code/service-mapping/other/ + parent: sci_service_mapping + identifier: sci_service_mapping_other + weight: 8 - name: Resource Mapping url: source_code/resource-mapping/ parent: source_code_integration diff --git a/content/en/source_code/service-mapping.md b/content/en/source_code/service-mapping.md deleted file mode 100644 index 3308f301752..00000000000 --- a/content/en/source_code/service-mapping.md +++ /dev/null @@ -1,394 +0,0 @@ ---- -title: Service Mapping for Source Code Integration -description: "Tag your APM telemetry with Git information to link services to source code." -further_reading: -- link: "/tracing/" - tag: "Documentation" - text: "Learn about APM" -- link: "/tracing/trace_collection/dd_libraries/" - tag: "Documentation" - text: "Learn about Datadog SDKs" ---- - -## Overview - -Datadog Agent v7.35.0 or later is required. - -If you have [APM][6] set up already, navigate to [{{< ui >}}Integrations{{< /ui >}} > {{< ui >}}Link Source Code{{< /ui >}}][7] and configure the source code integration for your backend services. - -Your telemetry must be tagged with Git information that ties the running application version with a particular repository and commit. - -For supported languages, Datadog recommends [embedding Git information](#embed-git-information-in-your-build-artifacts) in the deployed artifacts, which is then extracted by the [Datadog SDKs][9] automatically. - -For other languages and configurations, you can [configure telemetry tagging](#configure-telemetry-tagging) yourself. - -## Embed Git information in your build artifacts - -You can embed the repository URL and commit hash in your build artifact. The [Datadog SDKs][9] use this information to automatically add the right tags to your APM service telemetry. - -Select one of the following languages that supports embedding git information: - -{{< tabs >}} -{{% tab "Go" %}} - -
The Go client library version 1.48.0 or later is required.
- -### Containers - -If you are using Docker containers, you have three options: using Docker, using the Datadog SDK, or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Docker - -{{% sci-docker %}} - -#### Option 2: Datadog SDK - -{{% sci-dd-tracing-library %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Serverless - -If you are using Serverless, you have three options depending on your serverless application's setup. - -#### Option 1: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 2: Datadog SDK - -{{% sci-dd-tracing-library %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -If you are using a host, you have two options. - -#### Option 1: Datadog SDK - -{{% sci-dd-tracing-library %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -[101]: https://tip.golang.org/doc/go1.18 -[102]: https://www.npmjs.com/package/@datadog/datadog-ci -[103]: https://docs.datadoghq.com/serverless/libraries_integrations/plugin/ -[104]: https://github.com/DataDog/datadog-cdk-constructs - -{{% /tab %}} - -{{% tab "Python" %}} - -
The Python client library version 1.12.0 or later is required.
- -### Containers - -If you are using Docker containers, you have three options: using Docker, using Setuptools, or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Docker - -{{% sci-docker %}} - -#### Option 2: Setuptools or unified Python project settings file - -{{% sci-dd-setuptools-unified-python %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -[101]: https://github.com/DataDog/dd-trace-go -[102]: https://github.com/DataDog/hatch-datadog-build-metadata#readme - -### Serverless - -If you are using Serverless, you have three options depending on your serverless application's setup. - -#### Option 1: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 2: Setuptools or unified Python project settings file - -{{% sci-dd-setuptools-unified-python %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -If you are using a host, you have two options. - -#### Option 1: Setuptools or unified Python project settings file - -{{% sci-dd-setuptools-unified-python %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -{{% /tab %}} -{{% tab ".NET" %}} - -
The .NET client library version 2.24.1 or later is required.
- -As a first step, ensure that your `.pdb` files are deployed alongside your .NET assemblies (`.dll` or `.exe`) in the same folder. -Then, follow the rest of the instructions based on your specific deployment model: - -### Containers - -If you are using Docker containers, you have three options: using Docker, using Microsoft SourceLink, or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Docker - -{{% sci-docker %}} - -#### Option 2: Microsoft SourceLink - -{{% sci-microsoft-sourcelink %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Serverless - -If you are using Serverless, you have three options depending on your serverless application's setup. - -#### Option 1: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 2: Microsoft SourceLink - -{{% sci-microsoft-sourcelink %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -If you are using a host, you have two options: using Microsoft SourceLink or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Microsoft SourceLink - -{{% sci-microsoft-sourcelink %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -{{% /tab %}} -{{% tab "Node.js" %}} - -
- The Node.js client library version 3.21.0 or later is required. -
-
- For transpiled Node.js applications (for example, TypeScript), make sure to generate and publish source maps with the deployed application, and to run Node.js with the --enable-source-maps flag. Otherwise, code links and snippets will not work. -
- -### Containers - -If you are using Docker containers, you have three options: using a bundler plugin, using Docker, or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Bundler plugin - -{{% sci-dd-tags-bundled-node-js %}} - -#### Option 2: Docker - -{{% sci-docker %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Serverless - -If you are using Serverless, you have several options depending on your serverless application's setup. - -#### Option 1: Bundler plugin - -{{% sci-dd-tags-bundled-node-js %}} - -#### Option 2: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -For host-based environments, you have two options based on your build and deploy configuration. - -#### Option 1: Bundler plugin - -{{% sci-dd-tags-bundled-node-js %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -{{% /tab %}} -{{% tab "Ruby" %}} - -
The Ruby client library version 1.6.0 or later is required.
- -### Containers - -If you are using Docker containers, you have two options: using Docker or configuring your application with the `DD_TAGS` environment variable. - -#### Option 1: Docker - -{{% sci-docker-ddtags %}} - -#### Option 2: `DD_TAGS` environment variable - -{{% sci-dd-tags-env-variable %}} - -### Serverless - -If you are using Serverless, you have two options depending on your serverless application's setup. - -#### Option 1: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 2: `DD_TAGS` environment variable - -{{% sci-dd-tags-env-variable %}} - -### Host - -If you are using a host, configure your application with the `DD_TAGS` environment variable. - -{{% sci-dd-tags-env-variable %}} - -{{% /tab %}} -{{% tab "Java" %}} - -
-The Java client library version 1.48.0 or later is required for embedded git properties. Version 1.12.0 or later is required for other options. -
- -### Containers - -If you are using Docker containers, you have three options: embedding git properties in your build artifact, using Docker, or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Embedded git properties (recommended) - -{{% sci-java-git-properties %}} - -#### Option 2: Docker - -{{% sci-docker %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Serverless - -If you are using Serverless, you have three options depending on your serverless application's setup. - -#### Option 1: Embedded git properties (recommended) - -{{% sci-java-git-properties %}} - -#### Option 2: Datadog tooling - -{{% sci-dd-serverless %}} - -#### Option 3: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -If you are using a host, you have two options. - -#### Option 1: Embedded git properties (recommended) - -{{% sci-java-git-properties %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -{{% /tab %}} -{{% tab "PHP" %}} - -
PHP client library version 1.13.0 or later is required, or 1.2.0 or later if using tracing only without profiling.
- -### Containers - -If you are using Docker containers, you have two options: using Docker or configuring your application with `DD_GIT_*` environment variables. - -#### Option 1: Docker - -{{% sci-docker %}} - -#### Option 2: `DD_GIT_*` environment variables - -{{% sci-dd-git-env-variables %}} - -### Host - -If you are using a host, configure your application with `DD_GIT_*` environment variables. - -{{% sci-dd-git-env-variables %}} - -{{% /tab %}} -{{< /tabs >}} - -## Build inside a Docker container - -If your build process is executed in CI within a Docker container, use a [named context][docker-named-context] to make your `.git` folder available at build time: - -1. Add your `.git` folder as a named build context: - - ```shell - docker build [...] --build-context dotgit= - ``` - -2. In your `Dockerfile`, mount the `.git` folder before running your build: - - ```dockerfile - RUN --mount=from=dotgit,target= - ``` - -## Configure telemetry tagging - -If your language is not listed in the [Embed Git information](#embed-git-information-in-your-build-artifacts) section, you can manually tag your telemetry with Git information by setting environment variables in the environment where your application runs. - -Set the `DD_GIT_COMMIT_SHA` and `DD_GIT_REPOSITORY_URL` environment variables on your application's deployment: - -```shell -export DD_GIT_COMMIT_SHA="" -export DD_GIT_REPOSITORY_URL="" -``` - -Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. Replace `` with your repository URL. - -These environment variables add `git.commit.sha` and `git.repository_url` tags to your APM spans, linking your service to a specific commit in your source code repository. - -## Further reading - -{{< partial name="whats-next/whats-next.html" >}} - -[6]: /tracing/ -[7]: https://app.datadoghq.com/source-code/setup/apm -[9]: /tracing/trace_collection/dd_libraries/ -[docker-named-context]: https://docs.docker.com/build/concepts/context/#named-contexts diff --git a/content/en/source_code/service-mapping/_index.md b/content/en/source_code/service-mapping/_index.md new file mode 100644 index 00000000000..dcc47b6df09 --- /dev/null +++ b/content/en/source_code/service-mapping/_index.md @@ -0,0 +1,59 @@ +--- +title: Service Mapping for Source Code Integration +description: "Tag your APM telemetry with Git information to link services to source code." +further_reading: +- link: "/tracing/" + tag: "Documentation" + text: "Learn about APM" +- link: "/tracing/trace_collection/dd_libraries/" + tag: "Documentation" + text: "Learn about Datadog SDKs" +--- + +## Overview + +Your telemetry must be tagged with Git information that ties the running application version with a particular repository and commit. + +For supported languages, Datadog recommends [embedding Git information](#embed-git-information-in-your-build-artifacts) in the deployed artifacts, which is then extracted by the [Datadog SDKs][1] automatically. For other languages and configurations, see [Other Languages](/source_code/service-mapping/other/). + +
If you have APM set up already, navigate to {{< ui >}}Integrations{{< /ui >}} > {{< ui >}}Link Source Code{{< /ui >}} and configure the source code integration for your backend services.
+ +## Embed Git information in your build artifacts + +You can embed the repository URL and commit hash in your build artifact. The [Datadog SDKs][1] use this information to automatically add the right tags to your APM service telemetry. + +Select one of the following languages that supports embedding git information: + +{{< card-grid >}} + {{< image-card href="/source_code/service-mapping/go/" src="integrations_logos/go-metro.png" alt="Go" title="Go" >}} + {{< image-card href="/source_code/service-mapping/python/" src="integrations_logos/python.png" alt="Python" title="Python" >}} + {{< image-card href="/source_code/service-mapping/dotnet/" src="integrations_logos/dotnet-core.png" alt=".NET" title=".NET" >}} + {{< image-card href="/source_code/service-mapping/nodejs/" src="integrations_logos/nodejs.png" alt="Node.js" title="Node.js" >}} + {{< image-card href="/source_code/service-mapping/ruby/" src="integrations_logos/ruby.png" alt="Ruby" title="Ruby" >}} + {{< image-card href="/source_code/service-mapping/java/" src="integrations_logos/java.png" alt="Java" title="Java" >}} + {{< image-card href="/source_code/service-mapping/php/" src="integrations_logos/php.png" alt="PHP" title="PHP" >}} + {{< image-card href="/source_code/service-mapping/other/" title="Other Languages" >}} +{{< /card-grid >}} + +## Build inside a Docker container + +If your build process is executed in CI within a Docker container, use a [named context][2] to make your `.git` folder available at build time: + +1. Add your `.git` folder as a named build context: + + ```shell + docker build [...] --build-context dotgit= + ``` + +2. In your `Dockerfile`, mount the `.git` folder before running your build: + + ```dockerfile + RUN --mount=from=dotgit,target= + ``` + +## Further reading + +{{< partial name="whats-next/whats-next.html" >}} + +[1]: /tracing/trace_collection/dd_libraries/ +[2]: https://docs.docker.com/build/concepts/context/#named-contexts diff --git a/content/en/source_code/service-mapping/dotnet.md b/content/en/source_code/service-mapping/dotnet.md new file mode 100644 index 00000000000..3bfa7fe0fc8 --- /dev/null +++ b/content/en/source_code/service-mapping/dotnet.md @@ -0,0 +1,58 @@ +--- +title: Embed Git Information in Your .NET Build Artifacts +--- + +## Overview + +To embed Git information in your .NET build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The .NET client library version 2.24.1 or later is required. +- Ensure that your `.pdb` files are deployed alongside your .NET assemblies (`.dll` or `.exe`) in the same folder. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have three options: using Docker, using Microsoft SourceLink, or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Microsoft SourceLink" level="h3" %}} +{{% sci-microsoft-sourcelink %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have three options depending on your serverless application's setup. + +{{% collapse-content title="Option 1: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Microsoft SourceLink" level="h3" %}} +{{% sci-microsoft-sourcelink %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Host + +If you are using a host, you have two options: using Microsoft SourceLink or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Microsoft SourceLink" level="h3" %}} +{{% sci-microsoft-sourcelink %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} diff --git a/content/en/source_code/service-mapping/go.md b/content/en/source_code/service-mapping/go.md new file mode 100644 index 00000000000..bc18430773f --- /dev/null +++ b/content/en/source_code/service-mapping/go.md @@ -0,0 +1,66 @@ +--- +title: Embed Git Information in Your Go Build Artifacts +--- + +## Overview + +To embed Git information in your Go build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The Go client library version 1.48.0 or later is required. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have three options: using Docker, using the Datadog SDK, or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Datadog SDK" level="h3" %}} +{{% sci-dd-tracing-library %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have three options depending on your serverless application's setup. + +{{% tabs %}} + +{{% tab "Option 1: Datadog tooling" %}} +{{% sci-dd-serverless %}} +{{% /tab %}} + +{{% tab "Option 2: Datadog SDK" %}} +{{% sci-dd-tracing-library %}} +{{% /tab %}} + +{{% tab "Option 3: DD_GIT_* environment variables" %}} +{{% sci-dd-git-env-variables %}} +{{% /tab %}} + +{{% /tabs %}} + +## Host + +If you are using a host, you have two options. + +{{% collapse-content title="Option 1: Datadog SDK" level="h3" %}} +{{% sci-dd-tracing-library %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +[101]: https://tip.golang.org/doc/go1.18 +[102]: https://www.npmjs.com/package/@datadog/datadog-ci +[103]: https://docs.datadoghq.com/serverless/libraries_integrations/plugin/ +[104]: https://github.com/DataDog/datadog-cdk-constructs diff --git a/content/en/source_code/service-mapping/java.md b/content/en/source_code/service-mapping/java.md new file mode 100644 index 00000000000..2d4dd5e1302 --- /dev/null +++ b/content/en/source_code/service-mapping/java.md @@ -0,0 +1,57 @@ +--- +title: Embed Git Information in Your Java Build Artifacts +--- + +## Overview + +To embed Git information in your Java build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The Java client library version 1.48.0 or later is required for embedded git properties. Version 1.12.0 or later is required for other options. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have three options: embedding git properties in your build artifact, using Docker, or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% sci-java-git-properties %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have three options depending on your serverless application's setup. + +{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% sci-java-git-properties %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Host + +If you are using a host, you have two options. + +{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% sci-java-git-properties %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} diff --git a/content/en/source_code/service-mapping/nodejs.md b/content/en/source_code/service-mapping/nodejs.md new file mode 100644 index 00000000000..58d7ab059cc --- /dev/null +++ b/content/en/source_code/service-mapping/nodejs.md @@ -0,0 +1,59 @@ +--- +title: Embed Git Information in Your Node.js Build Artifacts +--- + +## Overview + +To embed Git information in your Node.js build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +
For transpiled Node.js applications (for example, TypeScript), generate and publish source maps with the deployed application. Run Node.js with the --enable-source-maps flag. Otherwise, code links and snippets do not work.
+ +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The Node.js client library version 3.21.0 or later is required. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have three options: using a bundler plugin, using Docker, or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Bundler plugin" level="h3" %}} +{{% sci-dd-tags-bundled-node-js %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have several options depending on your serverless application's setup. + +{{% collapse-content title="Option 1: Bundler plugin" level="h3" %}} +{{% sci-dd-tags-bundled-node-js %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Host + +For host-based environments, you have two options based on your build and deploy configuration. + +{{% collapse-content title="Option 1: Bundler plugin" level="h3" %}} +{{% sci-dd-tags-bundled-node-js %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} diff --git a/content/en/source_code/service-mapping/other.md b/content/en/source_code/service-mapping/other.md new file mode 100644 index 00000000000..3de1969dac4 --- /dev/null +++ b/content/en/source_code/service-mapping/other.md @@ -0,0 +1,25 @@ +--- +title: Embed Git Information in Your Build Artifacts +--- + +## Overview + +If your language is not listed in the [Embed Git information in your build artifacts](/source_code/service-mapping/#embed-git-information-in-your-build-artifacts) section, use this page to manually tag your telemetry with Git information by setting environment variables. + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Tag telemetry with Git information + +Set the `DD_GIT_COMMIT_SHA` and `DD_GIT_REPOSITORY_URL` environment variables on your application's deployment: + +```shell +export DD_GIT_COMMIT_SHA="" +export DD_GIT_REPOSITORY_URL="" +``` + +Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. Replace `` with your repository URL. + +These environment variables add `git.commit.sha` and `git.repository_url` tags to your APM spans, linking your service to a specific commit in your source code repository. diff --git a/content/en/source_code/service-mapping/php.md b/content/en/source_code/service-mapping/php.md new file mode 100644 index 00000000000..1697225d72e --- /dev/null +++ b/content/en/source_code/service-mapping/php.md @@ -0,0 +1,33 @@ +--- +title: Embed Git Information in Your PHP Build Artifacts +--- + +## Overview + +To embed Git information in your PHP build artifacts, follow the instructions for your deployment model: [Containers](#containers) or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- PHP client library version 1.13.0 or later is required, or 1.2.0 or later if using tracing only without profiling. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have two options: using Docker or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Host + +If you are using a host, configure your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="`DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} diff --git a/content/en/source_code/service-mapping/python.md b/content/en/source_code/service-mapping/python.md new file mode 100644 index 00000000000..c5424c76da1 --- /dev/null +++ b/content/en/source_code/service-mapping/python.md @@ -0,0 +1,60 @@ +--- +title: Embed Git Information in Your Python Build Artifacts +--- + +## Overview + +To embed Git information in your Python build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The Python client library version 1.12.0 or later is required. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have three options: using Docker, using Setuptools, or configuring your application with `DD_GIT_*` environment variables. + +{{% collapse-content title="Option 1: Docker" level="h3" %}} +{{% sci-docker %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Setuptools or unified Python project settings file" level="h3" %}} +{{% sci-dd-setuptools-unified-python %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have three options depending on your serverless application's setup. + +{{% collapse-content title="Option 1: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: Setuptools or unified Python project settings file" level="h3" %}} +{{% sci-dd-setuptools-unified-python %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +## Host + +If you are using a host, you have two options. + +{{% collapse-content title="Option 1: Setuptools or unified Python project settings file" level="h3" %}} +{{% sci-dd-setuptools-unified-python %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} +{{% sci-dd-git-env-variables %}} +{{% /collapse-content %}} + +[101]: https://github.com/DataDog/dd-trace-go +[102]: https://github.com/DataDog/hatch-datadog-build-metadata#readme diff --git a/content/en/source_code/service-mapping/ruby.md b/content/en/source_code/service-mapping/ruby.md new file mode 100644 index 00000000000..592d20c6b05 --- /dev/null +++ b/content/en/source_code/service-mapping/ruby.md @@ -0,0 +1,45 @@ +--- +title: Embed Git Information in Your Ruby Build Artifacts +--- + +## Overview + +To embed Git information in your Ruby build artifacts, follow the instructions for your deployment model: [Containers](#containers), [Serverless](#serverless), or [Host](#host). + +## Prerequisites + +- Datadog Agent v7.35.0 or later is required. +- The Ruby client library version 1.6.0 or later is required. +- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. + +## Containers + +If you are using Docker containers, you have two options: using Docker or configuring your application with the `DD_TAGS` environment variable. + +{{% collapse-content title="Option 1: Docker" level="h3" %}} +{{% sci-docker-ddtags %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_TAGS` environment variable" level="h3" %}} +{{% sci-dd-tags-env-variable %}} +{{% /collapse-content %}} + +## Serverless + +If you are using Serverless, you have two options depending on your serverless application's setup. + +{{% collapse-content title="Option 1: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /collapse-content %}} + +{{% collapse-content title="Option 2: `DD_TAGS` environment variable" level="h3" %}} +{{% sci-dd-tags-env-variable %}} +{{% /collapse-content %}} + +## Host + +If you are using a host, configure your application with the `DD_TAGS` environment variable. + +{{% collapse-content title="`DD_TAGS` environment variable" level="h3" %}} +{{% sci-dd-tags-env-variable %}} +{{% /collapse-content %}} diff --git a/layouts/shortcodes/collapse-content.html b/layouts/shortcodes/collapse-content.html index 8f95fd46827..031aed3405c 100644 --- a/layouts/shortcodes/collapse-content.html +++ b/layouts/shortcodes/collapse-content.html @@ -10,7 +10,8 @@
- {{ printf "<%s class='header-text-inner'>%s" $headingLevel (.Get "title") $headingLevel | safeHTML }} + {{- $title := .Get "title" | replaceRE "`([^`]+)`" "$1" -}} + {{ printf "<%s class='header-text-inner'>%s" $headingLevel $title $headingLevel | safeHTML }}
From 3a8477f418c9d8659ceb96a4fb0987ceb09a205d Mon Sep 17 00:00:00 2001 From: Cara Reaume Date: Wed, 8 Jul 2026 16:40:20 -0400 Subject: [PATCH 2/4] Switching trial tabs to expandable, minor cleanups on all pages --- .../en/source_code/service-mapping/_index.md | 6 ++--- .../en/source_code/service-mapping/dotnet.md | 4 +++- content/en/source_code/service-mapping/go.md | 23 +++++++------------ .../en/source_code/service-mapping/java.md | 10 ++++---- .../en/source_code/service-mapping/nodejs.md | 6 +++-- .../en/source_code/service-mapping/other.md | 6 +++-- content/en/source_code/service-mapping/php.md | 6 +++-- .../en/source_code/service-mapping/python.md | 5 ++-- .../en/source_code/service-mapping/ruby.md | 4 +++- 9 files changed, 37 insertions(+), 33 deletions(-) diff --git a/content/en/source_code/service-mapping/_index.md b/content/en/source_code/service-mapping/_index.md index dcc47b6df09..bfb684aad94 100644 --- a/content/en/source_code/service-mapping/_index.md +++ b/content/en/source_code/service-mapping/_index.md @@ -16,13 +16,13 @@ Your telemetry must be tagged with Git information that ties the running applica For supported languages, Datadog recommends [embedding Git information](#embed-git-information-in-your-build-artifacts) in the deployed artifacts, which is then extracted by the [Datadog SDKs][1] automatically. For other languages and configurations, see [Other Languages](/source_code/service-mapping/other/). -
If you have APM set up already, navigate to {{< ui >}}Integrations{{< /ui >}} > {{< ui >}}Link Source Code{{< /ui >}} and configure the source code integration for your backend services.
+
If you already have APM set up, navigate to {{< ui >}}Integrations{{< /ui >}} > {{< ui >}}Link Source Code{{< /ui >}} to configure the source code integration for your backend services.
## Embed Git information in your build artifacts -You can embed the repository URL and commit hash in your build artifact. The [Datadog SDKs][1] use this information to automatically add the right tags to your APM service telemetry. +You can embed a repository URL and commit hash in your build artifact. The [Datadog SDKs][1] use this information to automatically add the right tags to your APM service telemetry. -Select one of the following languages that supports embedding git information: +Select one of the following languages that support embedding git information: {{< card-grid >}} {{< image-card href="/source_code/service-mapping/go/" src="integrations_logos/go-metro.png" alt="Go" title="Go" >}} diff --git a/content/en/source_code/service-mapping/dotnet.md b/content/en/source_code/service-mapping/dotnet.md index 3bfa7fe0fc8..417cec8ffca 100644 --- a/content/en/source_code/service-mapping/dotnet.md +++ b/content/en/source_code/service-mapping/dotnet.md @@ -8,7 +8,7 @@ To embed Git information in your .NET build artifacts, follow the instructions f ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The .NET client library version 2.24.1 or later is required. - Ensure that your `.pdb` files are deployed alongside your .NET assemblies (`.dll` or `.exe`) in the same folder. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -56,3 +56,5 @@ If you are using a host, you have two options: using Microsoft SourceLink or con {{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} + +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/go.md b/content/en/source_code/service-mapping/go.md index bc18430773f..e07592ccb62 100644 --- a/content/en/source_code/service-mapping/go.md +++ b/content/en/source_code/service-mapping/go.md @@ -8,7 +8,7 @@ To embed Git information in your Go build artifacts, follow the instructions for ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The Go client library version 1.48.0 or later is required. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -32,21 +32,17 @@ If you are using Docker containers, you have three options: using Docker, using If you are using Serverless, you have three options depending on your serverless application's setup. -{{% tabs %}} - -{{% tab "Option 1: Datadog tooling" %}} +{{% collapse-content title="Option 1: Datadog tooling" level="h3" %}} {{% sci-dd-serverless %}} -{{% /tab %}} +{{% /collapse-content %}} -{{% tab "Option 2: Datadog SDK" %}} +{{% collapse-content title="Option 2: Datadog SDK" level="h3" %}} {{% sci-dd-tracing-library %}} -{{% /tab %}} +{{% /collapse-content %}} -{{% tab "Option 3: DD_GIT_* environment variables" %}} +{{% collapse-content title="Option 3: `DD_GIT_*` environment variables" level="h3" %}} {{% sci-dd-git-env-variables %}} -{{% /tab %}} - -{{% /tabs %}} +{{% /collapse-content %}} ## Host @@ -60,7 +56,4 @@ If you are using a host, you have two options. {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} -[101]: https://tip.golang.org/doc/go1.18 -[102]: https://www.npmjs.com/package/@datadog/datadog-ci -[103]: https://docs.datadoghq.com/serverless/libraries_integrations/plugin/ -[104]: https://github.com/DataDog/datadog-cdk-constructs +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/java.md b/content/en/source_code/service-mapping/java.md index 2d4dd5e1302..3342de0f6a3 100644 --- a/content/en/source_code/service-mapping/java.md +++ b/content/en/source_code/service-mapping/java.md @@ -8,7 +8,7 @@ To embed Git information in your Java build artifacts, follow the instructions f ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The Java client library version 1.48.0 or later is required for embedded git properties. Version 1.12.0 or later is required for other options. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -16,7 +16,7 @@ To embed Git information in your Java build artifacts, follow the instructions f If you are using Docker containers, you have three options: embedding git properties in your build artifact, using Docker, or configuring your application with `DD_GIT_*` environment variables. -{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% collapse-content title="Option 1 (recommended): Embedded git properties" level="h3" %}} {{% sci-java-git-properties %}} {{% /collapse-content %}} @@ -32,7 +32,7 @@ If you are using Docker containers, you have three options: embedding git proper If you are using Serverless, you have three options depending on your serverless application's setup. -{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% collapse-content title="Option 1 (recommended): Embedded git properties" level="h3" %}} {{% sci-java-git-properties %}} {{% /collapse-content %}} @@ -48,10 +48,12 @@ If you are using Serverless, you have three options depending on your serverless If you are using a host, you have two options. -{{% collapse-content title="Option 1: Embedded git properties (recommended)" level="h3" %}} +{{% collapse-content title="Option 1 (recommended): Embedded git properties" level="h3" %}} {{% sci-java-git-properties %}} {{% /collapse-content %}} {{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} + +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/nodejs.md b/content/en/source_code/service-mapping/nodejs.md index 58d7ab059cc..c8e3ff2f2ca 100644 --- a/content/en/source_code/service-mapping/nodejs.md +++ b/content/en/source_code/service-mapping/nodejs.md @@ -10,7 +10,7 @@ To embed Git information in your Node.js build artifacts, follow the instruction ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The Node.js client library version 3.21.0 or later is required. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -32,7 +32,7 @@ If you are using Docker containers, you have three options: using a bundler plug ## Serverless -If you are using Serverless, you have several options depending on your serverless application's setup. +If you are using Serverless, you have three options depending on your serverless application's setup. {{% collapse-content title="Option 1: Bundler plugin" level="h3" %}} {{% sci-dd-tags-bundled-node-js %}} @@ -57,3 +57,5 @@ For host-based environments, you have two options based on your build and deploy {{% collapse-content title="Option 2: `DD_GIT_*` environment variables" level="h3" %}} {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} + +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/other.md b/content/en/source_code/service-mapping/other.md index 3de1969dac4..50429c7ec6c 100644 --- a/content/en/source_code/service-mapping/other.md +++ b/content/en/source_code/service-mapping/other.md @@ -4,11 +4,11 @@ title: Embed Git Information in Your Build Artifacts ## Overview -If your language is not listed in the [Embed Git information in your build artifacts](/source_code/service-mapping/#embed-git-information-in-your-build-artifacts) section, use this page to manually tag your telemetry with Git information by setting environment variables. +If the language your service is written in is not listed in the [Embed Git information in your build artifacts](/source_code/service-mapping/#embed-git-information-in-your-build-artifacts) section, use this page to manually tag your telemetry with Git information by setting environment variables. ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Tag telemetry with Git information @@ -23,3 +23,5 @@ export DD_GIT_REPOSITORY_URL="" Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. Replace `` with your repository URL. These environment variables add `git.commit.sha` and `git.repository_url` tags to your APM spans, linking your service to a specific commit in your source code repository. + +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/php.md b/content/en/source_code/service-mapping/php.md index 1697225d72e..f8f9ddce35f 100644 --- a/content/en/source_code/service-mapping/php.md +++ b/content/en/source_code/service-mapping/php.md @@ -8,8 +8,8 @@ To embed Git information in your PHP build artifacts, follow the instructions fo ## Prerequisites -- Datadog Agent v7.35.0 or later is required. -- PHP client library version 1.13.0 or later is required, or 1.2.0 or later if using tracing only without profiling. +- [Datadog Agent][1] v7.35.0 or later is required. +- The PHP client library version 1.13.0 or later is required, or 1.2.0 or later if using tracing only without profiling. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers @@ -31,3 +31,5 @@ If you are using a host, configure your application with `DD_GIT_*` environment {{% collapse-content title="`DD_GIT_*` environment variables" level="h3" %}} {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} + +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/python.md b/content/en/source_code/service-mapping/python.md index c5424c76da1..a53cd43cf9c 100644 --- a/content/en/source_code/service-mapping/python.md +++ b/content/en/source_code/service-mapping/python.md @@ -8,7 +8,7 @@ To embed Git information in your Python build artifacts, follow the instructions ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The Python client library version 1.12.0 or later is required. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -56,5 +56,4 @@ If you are using a host, you have two options. {{% sci-dd-git-env-variables %}} {{% /collapse-content %}} -[101]: https://github.com/DataDog/dd-trace-go -[102]: https://github.com/DataDog/hatch-datadog-build-metadata#readme +[1]: /agent/ diff --git a/content/en/source_code/service-mapping/ruby.md b/content/en/source_code/service-mapping/ruby.md index 592d20c6b05..21acc8c9783 100644 --- a/content/en/source_code/service-mapping/ruby.md +++ b/content/en/source_code/service-mapping/ruby.md @@ -8,7 +8,7 @@ To embed Git information in your Ruby build artifacts, follow the instructions f ## Prerequisites -- Datadog Agent v7.35.0 or later is required. +- [Datadog Agent][1] v7.35.0 or later is required. - The Ruby client library version 1.6.0 or later is required. - If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. @@ -43,3 +43,5 @@ If you are using a host, configure your application with the `DD_TAGS` environme {{% collapse-content title="`DD_TAGS` environment variable" level="h3" %}} {{% sci-dd-tags-env-variable %}} {{% /collapse-content %}} + +[1]: /agent/ From c143ff8102a566d0069b4fdcae3d03079218b03a Mon Sep 17 00:00:00 2001 From: Cara Reaume Date: Wed, 15 Jul 2026 14:07:02 -0400 Subject: [PATCH 3/4] Removing Docker prereq from language-specific pages, reworking top-level page's overview --- content/en/source_code/service-mapping/_index.md | 8 +++++--- content/en/source_code/service-mapping/dotnet.md | 1 - content/en/source_code/service-mapping/go.md | 1 - content/en/source_code/service-mapping/java.md | 1 - content/en/source_code/service-mapping/nodejs.md | 1 - content/en/source_code/service-mapping/other.md | 3 +-- content/en/source_code/service-mapping/php.md | 1 - content/en/source_code/service-mapping/python.md | 1 - content/en/source_code/service-mapping/ruby.md | 1 - layouts/shortcodes/sci-dd-git-env-variables.en.md | 2 +- layouts/shortcodes/sci-dd-tags-env-variable.en.md | 2 +- 11 files changed, 8 insertions(+), 14 deletions(-) diff --git a/content/en/source_code/service-mapping/_index.md b/content/en/source_code/service-mapping/_index.md index bfb684aad94..30014914b1c 100644 --- a/content/en/source_code/service-mapping/_index.md +++ b/content/en/source_code/service-mapping/_index.md @@ -12,15 +12,15 @@ further_reading: ## Overview -Your telemetry must be tagged with Git information that ties the running application version with a particular repository and commit. +You can associate your APM [spans][3] with Git data to link a running application version with a particular repository and commit. This unlocks [source code features][4] in APM-powered products. -For supported languages, Datadog recommends [embedding Git information](#embed-git-information-in-your-build-artifacts) in the deployed artifacts, which is then extracted by the [Datadog SDKs][1] automatically. For other languages and configurations, see [Other Languages](/source_code/service-mapping/other/). +[Embed Git information](#embed-git-information-in-your-build-artifacts) in your deployed build artifacts to allow [Datadog SDKs][1] to read it and automatically attach `git.commit.sha` and `git.repository_url` tags to every span.
If you already have APM set up, navigate to {{< ui >}}Integrations{{< /ui >}} > {{< ui >}}Link Source Code{{< /ui >}} to configure the source code integration for your backend services.
## Embed Git information in your build artifacts -You can embed a repository URL and commit hash in your build artifact. The [Datadog SDKs][1] use this information to automatically add the right tags to your APM service telemetry. +You can embed a repository URL and commit hash in your build artifact. The [Datadog SDKs][1] use this information to automatically add tags to your APM service telemetry. Select one of the following languages that support embedding git information: @@ -57,3 +57,5 @@ If your build process is executed in CI within a Docker container, use a [named [1]: /tracing/trace_collection/dd_libraries/ [2]: https://docs.docker.com/build/concepts/context/#named-contexts +[3]: /glossary/#span +[4]: /source_code/features/ diff --git a/content/en/source_code/service-mapping/dotnet.md b/content/en/source_code/service-mapping/dotnet.md index 417cec8ffca..060367e68c9 100644 --- a/content/en/source_code/service-mapping/dotnet.md +++ b/content/en/source_code/service-mapping/dotnet.md @@ -11,7 +11,6 @@ To embed Git information in your .NET build artifacts, follow the instructions f - [Datadog Agent][1] v7.35.0 or later is required. - The .NET client library version 2.24.1 or later is required. - Ensure that your `.pdb` files are deployed alongside your .NET assemblies (`.dll` or `.exe`) in the same folder. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/go.md b/content/en/source_code/service-mapping/go.md index e07592ccb62..1990a43750f 100644 --- a/content/en/source_code/service-mapping/go.md +++ b/content/en/source_code/service-mapping/go.md @@ -10,7 +10,6 @@ To embed Git information in your Go build artifacts, follow the instructions for - [Datadog Agent][1] v7.35.0 or later is required. - The Go client library version 1.48.0 or later is required. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/java.md b/content/en/source_code/service-mapping/java.md index 3342de0f6a3..4081a39da61 100644 --- a/content/en/source_code/service-mapping/java.md +++ b/content/en/source_code/service-mapping/java.md @@ -10,7 +10,6 @@ To embed Git information in your Java build artifacts, follow the instructions f - [Datadog Agent][1] v7.35.0 or later is required. - The Java client library version 1.48.0 or later is required for embedded git properties. Version 1.12.0 or later is required for other options. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/nodejs.md b/content/en/source_code/service-mapping/nodejs.md index c8e3ff2f2ca..0f1046ef84c 100644 --- a/content/en/source_code/service-mapping/nodejs.md +++ b/content/en/source_code/service-mapping/nodejs.md @@ -12,7 +12,6 @@ To embed Git information in your Node.js build artifacts, follow the instruction - [Datadog Agent][1] v7.35.0 or later is required. - The Node.js client library version 3.21.0 or later is required. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/other.md b/content/en/source_code/service-mapping/other.md index 50429c7ec6c..569f8efa389 100644 --- a/content/en/source_code/service-mapping/other.md +++ b/content/en/source_code/service-mapping/other.md @@ -9,9 +9,8 @@ If the language your service is written in is not listed in the [Embed Git infor ## Prerequisites - [Datadog Agent][1] v7.35.0 or later is required. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. -## Tag telemetry with Git information +## Tag telemetry by setting environment variables Set the `DD_GIT_COMMIT_SHA` and `DD_GIT_REPOSITORY_URL` environment variables on your application's deployment: diff --git a/content/en/source_code/service-mapping/php.md b/content/en/source_code/service-mapping/php.md index f8f9ddce35f..be19d199d91 100644 --- a/content/en/source_code/service-mapping/php.md +++ b/content/en/source_code/service-mapping/php.md @@ -10,7 +10,6 @@ To embed Git information in your PHP build artifacts, follow the instructions fo - [Datadog Agent][1] v7.35.0 or later is required. - The PHP client library version 1.13.0 or later is required, or 1.2.0 or later if using tracing only without profiling. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/python.md b/content/en/source_code/service-mapping/python.md index a53cd43cf9c..4354b5aeb0d 100644 --- a/content/en/source_code/service-mapping/python.md +++ b/content/en/source_code/service-mapping/python.md @@ -10,7 +10,6 @@ To embed Git information in your Python build artifacts, follow the instructions - [Datadog Agent][1] v7.35.0 or later is required. - The Python client library version 1.12.0 or later is required. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/content/en/source_code/service-mapping/ruby.md b/content/en/source_code/service-mapping/ruby.md index 21acc8c9783..e580b0f28bb 100644 --- a/content/en/source_code/service-mapping/ruby.md +++ b/content/en/source_code/service-mapping/ruby.md @@ -10,7 +10,6 @@ To embed Git information in your Ruby build artifacts, follow the instructions f - [Datadog Agent][1] v7.35.0 or later is required. - The Ruby client library version 1.6.0 or later is required. -- If your CI build runs inside a Docker container, see [Build inside a Docker container](/source_code/service-mapping/#build-inside-a-docker-container) to make your `.git` folder available before building. ## Containers diff --git a/layouts/shortcodes/sci-dd-git-env-variables.en.md b/layouts/shortcodes/sci-dd-git-env-variables.en.md index d2bfc4ce32b..660da80b7f2 100644 --- a/layouts/shortcodes/sci-dd-git-env-variables.en.md +++ b/layouts/shortcodes/sci-dd-git-env-variables.en.md @@ -5,4 +5,4 @@ export DD_GIT_COMMIT_SHA="" export DD_GIT_REPOSITORY_URL="" ``` -Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. \ No newline at end of file +Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. Replace `` with your repository URL. \ No newline at end of file diff --git a/layouts/shortcodes/sci-dd-tags-env-variable.en.md b/layouts/shortcodes/sci-dd-tags-env-variable.en.md index bb8053ef4b1..87f3c9f0486 100644 --- a/layouts/shortcodes/sci-dd-tags-env-variable.en.md +++ b/layouts/shortcodes/sci-dd-tags-env-variable.en.md @@ -4,4 +4,4 @@ Configure your application with the `DD_TAGS` environment variable: export DD_TAGS="git.commit.sha:,git.repository_url:" ``` -Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. \ No newline at end of file +Replace `` with the commit SHA used to build your application. You can retrieve this by running `git rev-parse HEAD` at build time, and it needs to be passed into the runtime environment variables. Replace `` with your repository URL. \ No newline at end of file From c101593ffdb462cefc7b542405516d232b8a779b Mon Sep 17 00:00:00 2001 From: Cara Reaume <35357020+clreaume@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:52:22 -0400 Subject: [PATCH 4/4] Apply suggestion from @StefonSimmons Co-authored-by: StefonSimmons <57869435+StefonSimmons@users.noreply.github.com> --- layouts/shortcodes/collapse-content.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/collapse-content.html b/layouts/shortcodes/collapse-content.html index 031aed3405c..db91e40b0bd 100644 --- a/layouts/shortcodes/collapse-content.html +++ b/layouts/shortcodes/collapse-content.html @@ -10,8 +10,8 @@
- {{- $title := .Get "title" | replaceRE "`([^`]+)`" "$1" -}} - {{ printf "<%s class='header-text-inner'>%s" $headingLevel $title $headingLevel | safeHTML }} + {{- $title := .Get "title" | .Page.RenderString -}} + {{ printf "<%s class='header-text-inner'>%s" $headingLevel $title $headingLevel | safeHTML }}