---
title: "Tracing"
description: "Learn how to enable tracing and capture performance data from your Godot Engine game."
url: https://docs.sentry.io/platforms/godot/tracing/
---

# Set Up Tracing | Sentry for Godot Engine

Available since: `v2.2.0`

Tracing shows how long operations in your game take and how that work is connected. Use it to find slow level loads, world generation, save operations, and other work that affects the player experience. Errors and other telemetry captured while a span is active carry its trace context, which keeps the failure next to the work that caused it.

These pages cover tracing in GDScript. For C#, use the [Sentry .NET tracing API](https://docs.sentry.io/platforms/dotnet/tracing.md).

## [Configure](https://docs.sentry.io/platforms/godot/tracing.md#configure)

The SDK doesn't send traces by default. To enable tracing, open **Project Settings > Sentry > Options** and set **Traces Sample Rate** to a number between `0.0` and `1.0`.

Start with `1.0` while testing so that every trace is sent. Before shipping, lower the value to match the amount of performance data you need. For example, `0.2` sends approximately 20% of traces. The SDK makes one sampling decision for the whole trace, so it sends either every span in that trace or none of them.

If you initialize the SDK from GDScript, set `traces_sample_rate` in the configuration callback instead:

```GDScript
class_name ProjectMainLoop
extends SceneTree

func _initialize() -> void:
	SentrySDK.init(func(options: SentryOptions) -> void:
		options.traces_sample_rate = 1.0
	)
```

Manual initialization requires disabling **Auto Init** and assigning the script as the main loop type. See [Programmatic Configuration](https://docs.sentry.io/platforms/godot/configuration/options.md#programmatic-configuration) for the complete setup.

Web exports can also stream completed spans instead of holding them until the root span ends. See the [`trace_lifecycle` option](https://docs.sentry.io/platforms/godot/configuration/options.md#trace_lifecycle) for details and platform limitations.

## [Verify](https://docs.sentry.io/platforms/godot/tracing.md#verify)

Create and end a span around a known operation, then run the game and confirm that the trace appears in Sentry. The SDK for Godot Engine doesn't create spans automatically yet, so continue with [Instrumentation](https://docs.sentry.io/platforms/godot/tracing/instrumentation.md) to add one.

## [Distributed Tracing](https://docs.sentry.io/platforms/godot/tracing.md#distributed-tracing)

To follow a request from your game into your backend, [set up distributed tracing](https://docs.sentry.io/platforms/godot/tracing/distributed-tracing.md) and attach the span's trace headers to the request.

## [Next Steps](https://docs.sentry.io/platforms/godot/tracing.md#next-steps)

* #### [Instrumentation](https://docs.sentry.io/platforms/godot/tracing/instrumentation.md)

  Learn how to add spans that measure operations in your Godot Engine game.

* #### [Set Up Distributed Tracing](https://docs.sentry.io/platforms/godot/tracing/distributed-tracing.md)

  Learn how to connect operations in your Godot game with requests to your backend services.

## Pages in this section

- [Instrumentation](https://docs.sentry.io/platforms/godot/tracing/instrumentation.md)
- [Set Up Distributed Tracing](https://docs.sentry.io/platforms/godot/tracing/distributed-tracing.md)
