---
title: "Transaction Name"
description: "Learn how to set or override the transaction name to capture the user and gain critical pieces of information that construct a unique identity in Sentry using the Python SDK."
url: https://docs.sentry.io/platforms/python/enriching-events/transaction-name/
---

# Transaction Name for Python

The transaction name is the name of the current service span, the span that represents your service's entry point, such as an incoming HTTP request or a task. It's used in our [pre-built Sentry Dashboards](https://docs.sentry.io/product/dashboards/sentry-dashboards.md) product, and to annotate error events with their point of failure.

The transaction name can reference the current web app route, or the current task being executed. For example:

* `GET /api/{version}/users/`
* `UserListView`
* `myapp.tasks.renew_all_subscriptions`

Ideally, the transaction name does not contain variable values such as user IDs but has rather low cardinality while still uniquely identifying a piece of code you care about.

A lot of our framework integrations already set a transaction name, though you can set one yourself.

To override the name of the current service span and the transaction name on error events:

```python
import sentry_sdk

scope = sentry_sdk.get_current_scope()
scope.set_transaction_name("UserListView")
```

In SDK `2.x`, this sets the name of the currently running transaction.

See [Tracing](https://docs.sentry.io/platforms/python/tracing.md) for how to start and end spans.

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
