> ## Documentation Index
> Fetch the complete documentation index at: https://agent-observability-docs.splunk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# telemetry_toggle

## Module

Decorators for conditionally enabling/disabling Splunk AO telemetry.

These decorators check the SPLUNK\_AO\_LOGGING\_DISABLED environment variable
and skip execution of telemetry operations when disabled.

## nop\_async

```python theme={null}
def nop_async(f: Callable) -> Callable
```

Decorator that skips execution of async functions when Splunk AO logging is disabled.

When SPLUNK\_AO\_LOGGING\_DISABLED is set to "true", "1", or "t", the decorated
function will not execute and will return None instead.

**Arguments**

* `f` (`Callable`): The asynchronous function to wrap.

**Returns**

* `Callable`: A wrapped async function that checks the logging toggle before execution.

## nop\_sync

```python theme={null}
def nop_sync(f: Callable) -> Callable
```

Decorator that skips execution of sync functions when Splunk AO logging is disabled.

When SPLUNK\_AO\_LOGGING\_DISABLED is set to "true", "1", or "t", the decorated
function will not execute and will return None instead.

**Arguments**

* `f` (`Callable`): The synchronous function to wrap.

**Returns**

* `Callable`: A wrapped function that checks the logging toggle before execution.

## splunk\_ao\_logging\_enabled

```python theme={null}
def splunk_ao_logging_enabled() -> bool
```

Check if Splunk AO logging/telemetry is enabled.

**Returns**

* `bool`: True if logging is enabled (default), False if SPLUNK\_AO\_LOGGING\_DISABLED is set.
