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

## Syntax

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

Prevents the current transaction from contributing to Apdex.

## Description

This call suppresses the generation of the [Apdex metric](https://docs.newrelic.com/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction) for a web transaction. You might wish to do this when a long-running transaction is frequently affecting the average Apdex score for your application.

To un-suppress a previously suppressed transaction, set the flag to `False`.

> #### 💡 TIP
>
> You can also suppress the Apdex metric in the WSGI environ dictionary. To do so, set `newrelic.suppress_apdex_metric` 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's Apdex has been previously suppressed, you can un-suppress it by setting the flag to `False`. |

## Return values

None.

## Examples

### Turn off Apdex for specific transaction [#apdex-example]

If you have frequent, long-running functions in your app that are causing your average Apdex to go down, you can call `suppress_apdex_metric` where the transaction is being generated:

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