---
title: suppress_transaction_trace (Python agent API)
source: https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/suppresstransactiontrace-python-agent-api
---

## Syntax

```py
newrelic.agent.suppress_transaction_trace(flag=True)
```

Prevents the current transaction from generating a transaction trace.

## Description

This call prevents the current transaction from producing a [transaction trace](https://docs.newrelic.com/docs/apm/transactions/transaction-traces/introduction-transaction-traces).

You can use this if you have a recurring long-running transaction from which you rarely want to see a transaction trace. However, our algorithm for selecting transaction traces already de-prioritizes traces for transactions that have recently generated a trace. Thus, this call is not usually needed.

To un-suppress a previously suppressed transaction, you would use `flag=False`.

> #### 💡 TIP
>
> You can also prevent a transaction from producing traces with a WSGI environ dictionary. To do se, set the `newrelic.suppress_transaction_trace` key for the specific request in the WSGI environ dictionary passed by the WSGI server into the WSGI application being monitored.

## Parameters

| Parameter        | Description                                                                                                                                              |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `flag` _boolean_ | Optional. Default is `True`. If a transaction has been previously blocked from producing a trace, you can un-suppress it by setting the flag to `False`. |

## Return values

None.

## Examples

### Suppress transaction trace [#trace-example]

In this example, you have some URLs or views where your customers often upload files. These frequently slow transactions generate transaction traces more often than is useful, and you'd like to disable transaction traces on these so you will receive more relevant traces.

To disable traces for these transactions, run the following where the transaction is being executed:

```py
import newrelic.agent
newrelic.agent.suppress_transaction_trace()
```
