---
title: "Limiting Trace Propagation"
description: "Learn how to restrict outgoing trace headers to trusted backend services in your Godot game."
url: https://docs.sentry.io/platforms/godot/tracing/distributed-tracing/limiting-trace-propagation/
---

# Limiting Trace Propagation for Godot Engine

By default, `SentryHTTPRequest` adds tracing headers and `SentrySpan.get_trace_headers(url)` returns them for any destination URL. To restrict propagation to specific services, configure [`trace_propagation_targets`](https://docs.sentry.io/platforms/godot/configuration/options.md#trace_propagation_targets):

```GDScript
class_name ProjectMainLoop
extends SceneTree

func _initialize() -> void:
	SentrySDK.init(func(options: SentryOptions) -> void:
		options.trace_propagation_targets = [
			RegEx.create_from_string("^https://api\\.example\\.com/"),
		]
	)
```

This matches URLs such as `https://api.example.com/scores`. See [Programmatic Configuration](https://docs.sentry.io/platforms/godot/configuration/options.md#programmatic-configuration) for the manual initialization setup.

`SentryHTTPRequest` applies these targets to the initial request URL automatically. For [custom trace propagation](https://docs.sentry.io/platforms/godot/tracing/distributed-tracing/custom-trace-propagation.md), pass the destination URL to `SentrySpan.get_trace_headers(url)` to apply the same filter. When a URL doesn't match, or when the target list is empty, `SentryHTTPRequest` doesn't add tracing headers and `SentrySpan.get_trace_headers(url)` returns an empty array. Calling `get_trace_headers()` without a URL bypasses filtering.

The [option reference](https://docs.sentry.io/platforms/godot/configuration/options.md#trace_propagation_targets) explains string and regular expression matching and configuration through Project Settings.
