---
title: Service Mapping for Source Code Integration
description: Tag your APM telemetry with Git information to link services to source code.
breadcrumbs: Docs > Source Code Integration > Service Mapping for Source Code Integration
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Service Mapping for Source Code Integration

## Overview{% #overview %}

You can associate your APM [spans](https://docs.datadoghq.com/glossary.md#span) with Git data to link a running application version with a particular repository and commit. This unlocks [source code features](https://docs.datadoghq.com/source_code/features.md) in APM-powered products.

Embed Git information in your deployed build artifacts to allow [Datadog SDKs](https://docs.datadoghq.com/tracing/trace_collection/dd_libraries.md) to read it and automatically attach `git.commit.sha` and `git.repository_url` tags to every span.

{% alert level="info" %}
If you already have [APM](https://docs.datadoghq.com/tracing.md) set up, navigate to [Integrations > Link Source Code](https://app.datadoghq.com/source-code/setup/apm) to configure the source code integration for your backend services.
{% /alert %}

## Embed Git information in your build artifacts{% #embed-git-information-in-your-build-artifacts %}

You can embed a repository URL and commit hash in your build artifact. The [Datadog SDKs](https://docs.datadoghq.com/tracing/trace_collection/dd_libraries.md) use this information to automatically add tags to your APM service telemetry.

Select one of the following languages that support embedding Git information:

- [dotnet](https://docs.datadoghq.com/source_code/service-mapping/dotnet.md)
- [go](https://docs.datadoghq.com/source_code/service-mapping/go.md)
- [java](https://docs.datadoghq.com/source_code/service-mapping/java.md)
- [nodejs](https://docs.datadoghq.com/source_code/service-mapping/nodejs.md)
- [php](https://docs.datadoghq.com/source_code/service-mapping/php.md)
- [python](https://docs.datadoghq.com/source_code/service-mapping/python.md)
- [ruby](https://docs.datadoghq.com/source_code/service-mapping/ruby.md)
- [Other Languages](https://docs.datadoghq.com/source_code/service-mapping/other.md)

## Build inside a Docker container{% #build-inside-a-docker-container %}

If your build process is executed in CI within a Docker container, use a [named context](https://docs.docker.com/build/concepts/context/#named-contexts) 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=<path to your local .git folder>
   ```

1. In your `Dockerfile`, mount the `.git` folder before running your build:

   ```dockerfile
   RUN --mount=from=dotgit,target=<path to where you expect .git to be in your build container> <your build command>
   ```

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Learn about APM](https://docs.datadoghq.com/tracing.md)
- [Learn about Datadog SDKs](https://docs.datadoghq.com/tracing/trace_collection/dd_libraries.md)
