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..30014914b1c --- /dev/null +++ b/content/en/source_code/service-mapping/_index.md @@ -0,0 +1,61 @@ +--- +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 + +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. + +[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 tags to your APM service telemetry. + +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" >}} + {{< 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 +[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 new file mode 100644 index 00000000000..060367e68c9 --- /dev/null +++ b/content/en/source_code/service-mapping/dotnet.md @@ -0,0 +1,59 @@ +--- +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][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. + +## 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 %}} + +[1]: /agent/ 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..1990a43750f --- /dev/null +++ b/content/en/source_code/service-mapping/go.md @@ -0,0 +1,58 @@ +--- +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][1] v7.35.0 or later is required. +- 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. + +{{% 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. + +{{% collapse-content title="Option 1: Datadog tooling" level="h3" %}} +{{% sci-dd-serverless %}} +{{% /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 %}} + +## 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 %}} + +[1]: /agent/ 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..4081a39da61 --- /dev/null +++ b/content/en/source_code/service-mapping/java.md @@ -0,0 +1,58 @@ +--- +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][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. + +## 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 (recommended): Embedded git properties" 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 (recommended): Embedded git properties" 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 (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 new file mode 100644 index 00000000000..0f1046ef84c --- /dev/null +++ b/content/en/source_code/service-mapping/nodejs.md @@ -0,0 +1,60 @@ +--- +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][1] v7.35.0 or later is required. +- The Node.js client library version 3.21.0 or later is required. + +## 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 three 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 %}} + +[1]: /agent/ 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..569f8efa389 --- /dev/null +++ b/content/en/source_code/service-mapping/other.md @@ -0,0 +1,26 @@ +--- +title: Embed Git Information in Your Build Artifacts +--- + +## Overview + +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][1] v7.35.0 or later is required. + +## Tag telemetry by setting environment variables + +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. + +[1]: /agent/ 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..be19d199d91 --- /dev/null +++ b/content/en/source_code/service-mapping/php.md @@ -0,0 +1,34 @@ +--- +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][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. + +## 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 %}} + +[1]: /agent/ 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..4354b5aeb0d --- /dev/null +++ b/content/en/source_code/service-mapping/python.md @@ -0,0 +1,58 @@ +--- +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][1] v7.35.0 or later is required. +- 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. + +{{% 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 %}} + +[1]: /agent/ 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..e580b0f28bb --- /dev/null +++ b/content/en/source_code/service-mapping/ruby.md @@ -0,0 +1,46 @@ +--- +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][1] v7.35.0 or later is required. +- 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. + +{{% 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 %}} + +[1]: /agent/ diff --git a/layouts/shortcodes/collapse-content.html b/layouts/shortcodes/collapse-content.html index 8f95fd46827..db91e40b0bd 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" | .Page.RenderString -}} + {{ printf "<%s class='header-text-inner'>%s" $headingLevel $title $headingLevel | safeHTML }}
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