This product is not supported for your selected Datadog site. ().
Join the Preview!
Code Coverage is in Preview. This product replaces Test Optimization's code coverage feature, which is being deprecated. Complete the form to request access for the new Code Coverage product.
You can configure Code Coverage behavior by creating a configuration file named code-coverage.datadog.yml or code-coverage.datadog.yaml in the root of your repository.
Using Software Catalog integration is the recommended approach for defining services, as code locations configured in Software Catalog can be used by multiple Datadog products. Use manual configuration only when Software Catalog integration is not available.
You can define services in your configuration file to split coverage data by service in monorepos. This is useful when multiple projects or teams share a single repository and you want to view coverage metrics for each service independently.
You can exclude specific files or directories from code coverage reporting using the ignore field. This is useful for excluding test files, generated code, vendor dependencies, and other files that should not be included in coverage metrics. Path patterns support glob, regex, and prefix matching (see Pattern syntax).
ignore:- "test/**/*"# Exclude all files in test directory- "*.pb.go"# Exclude all protobuf generated files- "vendor/"# Exclude vendor directory
Exceptions
Add ! before a pattern to create an exception to your ignore rules. This lets you include specific files or folders that would otherwise be excluded.