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 tracing library, or configuring your application with DD_GIT_*
environment variables.
Option 1: Docker
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Option 2: Datadog Tracing Library
Go embeds version control information in binaries since version 1.18. The Datadog tracing library uses this information to tag your telemetry with the latest commit SHA and repository URL.
Ensure your service meets the following requirements to use this approach:
- Go version is 1.18 or later.
- The service is built as a go module and the module path is your code’s repository URL.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have three options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
Option 2: Datadog Tracing Library
Go embeds version control information in binaries since version 1.18. The Datadog tracing library uses this information to tag your telemetry with the latest commit SHA and repository URL.
Ensure your service meets the following requirements to use this approach:
- Go version is 1.18 or later.
- The service is built as a go module and the module path is your code’s repository URL.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, you have two options.
Option 1: Datadog Tracing Library
Go embeds version control information in binaries since version 1.18. The Datadog tracing library uses this information to tag your telemetry with the latest commit SHA and repository URL.
Ensure your service meets the following requirements to use this approach:
- Go version is 1.18 or later.
- The service is built as a go module and the module path is your code’s repository URL.
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
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 the Datadog tracing library, or configuring your application with DD_GIT_*
environment variables.
Option 1: Docker
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
If your application is packaged with setuptools:
- Install the
dd-trace
package. - Add
import ddtrace.sourcecode.setuptools_auto
as the first import to the setup.py
file. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
If your application is using a unified Python project settings file:
- Install the
hatch-datadog-build-metadata
plugin and configure it to embed git metadata. If a project already has URLs, reconfigure them as dynamic and move them to another configuration section. For more information, see the plugin source code. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have three options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
If your application is packaged with setuptools:
- Install the
dd-trace
package. - Add
import ddtrace.sourcecode.setuptools_auto
as the first import to the setup.py
file. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
If your application is using a unified Python project settings file:
- Install the
hatch-datadog-build-metadata
plugin and configure it to embed git metadata. If a project already has URLs, reconfigure them as dynamic and move them to another configuration section. For more information, see the plugin source code. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, you have two options.
If your application is packaged with setuptools:
- Install the
dd-trace
package. - Add
import ddtrace.sourcecode.setuptools_auto
as the first import to the setup.py
file. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
If your application is using a unified Python project settings file:
- Install the
hatch-datadog-build-metadata
plugin and configure it to embed git metadata. If a project already has URLs, reconfigure them as dynamic and move them to another configuration section. For more information, see the plugin source code. - Set the
DD_MAIN_PACKAGE
environment variable as the name of the primary Python package.
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
The .NET client library version 2.24.1 or later is required.
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
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Option 2: Microsoft SourceLink
If you are using Microsoft SourceLink, Datadog can extract the git commit SHA and repository URL from your .NET assembly.
Open your project’s file (.csproj
) in an IDE and add a reference to one of the following NuGet packages, depending on where your git repository is hosted:
Ensure that your .pdb
files are deployed alongside your .NET assemblies (.dll
or .exe
) in the same folder.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have three options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
Option 2: Microsoft SourceLink
If you are using Microsoft SourceLink, Datadog can extract the git commit SHA and repository URL from your .NET assembly.
Open your project’s file (.csproj
) in an IDE and add a reference to one of the following NuGet packages, depending on where your git repository is hosted:
Ensure that your .pdb
files are deployed alongside your .NET assemblies (.dll
or .exe
) in the same folder.
Option 3: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
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
If you are using Microsoft SourceLink, Datadog can extract the git commit SHA and repository URL from your .NET assembly.
Open your project’s file (.csproj
) in an IDE and add a reference to one of the following NuGet packages, depending on where your git repository is hosted:
Ensure that your .pdb
files are deployed alongside your .NET assemblies (.dll
or .exe
) in the same folder.
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
The NodeJS client library version 3.21.0 or later is required.
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
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have two options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, configure your application with DD_GIT_*
environment variables.
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
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
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_TAGS="git.repository_url:${DD_GIT_REPOSITORY_URL},git.commit.sha:${DD_GIT_COMMIT_SHA}"
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Configure your application with the DD_TAGS
environment variable:
export DD_TAGS="git.commit.sha:<commitSha>,git.repository_url:<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have two options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
Configure your application with the DD_TAGS
environment variable:
export DD_TAGS="git.commit.sha:<commitSha>,git.repository_url:<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, configure your application with the DD_TAGS
environment variable.
Configure your application with the DD_TAGS
environment variable:
export DD_TAGS="git.commit.sha:<commitSha>,git.repository_url:<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
The Java client library version 1.12.0 or later is required.
If you are using Docker containers, you have two options: using Docker or configuring your application with DD_GIT_*
environment variables.
Option 1: Docker
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Serverless
If you are using Serverless, you have two options depending on your serverless application’s setup.
- Datadog CLI tool
- Use the
datadog-ci
client version 2.4.1 or later. You must run the CLI tool in the same directory as the code repository. - Datadog Serverless Plugin
- Use the plugin version 5.18.0 or later.
- Datadog CDK Construct
- Use the
datadog-cdk-constructs
version 0.8.5 or later for AWS CDK v1.Use the datadog-cdk-constructs
version 1.4.0 or later for AWS CDK v2.
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, configure your application with DD_GIT_*
environment variables.
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
The PHP client library version 1.2.0 or later is required.
If you are using Docker containers, you have two options: using Docker or configuring your application with DD_GIT_*
environment variables.
Option 1: Docker
Add the following lines to your application’s Dockerfile:
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
Add the following arguments to your Docker build command:
docker build . \
-t my-application \
--build-arg DD_GIT_REPOSITORY_URL=<git-provider.example/me/my-repo> \
--build-arg DD_GIT_COMMIT_SHA=$(git rev-parse HEAD)
Option 2: DD_GIT_*
Environment Variables
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.
Host
If you are using a host, configure your application with DD_GIT_*
environment variables.
Configure your application with the DD_GIT_*
environment variables:
export DD_GIT_COMMIT_SHA="<commitSha>"
export DD_GIT_REPOSITORY_URL="<git-provider.example/me/my-repo>"
Replace <commitSha>
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.