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

# Monitoring

> How to collect diagnostic information for Atoti Intelligence at runtime, including DEBUG logging for Auto-Explain and Visualize This in `application.yaml`, Spring AI logback configuration, and resolutions for MCP server context path and keep-alive issues.

This page explains how to monitor and diagnose Atoti Intelligence features, including Auto-Explain, Visualize This, and the MCP server.

## Why monitor Atoti Intelligence?

Monitoring provides visibility into the behavior of AI features at runtime. It helps identify configuration problems, connectivity issues, and unexpected behavior before they affect end users.

Increasing log verbosity is the primary way to collect detailed diagnostic information. Combined with common pitfall resolutions, this page covers the most common situations encountered when operating Atoti Intelligence features.

## How to collect diagnostic information

When reporting an issue, gather the following information:

* Application logs at the relevant log level
* Browser console output
* Screenshots of the issue

<Tip>
  Enable DEBUG logging before reproducing the issue. This captures more detail and makes logs more useful for diagnosis.
</Tip>

## How to increase logging levels

The following sections explain how to enable DEBUG-level logging for each Atoti Intelligence feature.

### Auto-Explain

Set Auto-Explain logging to DEBUG level in the application configuration file.

Add the following to `application.yaml`:

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
logging:
  level:
    atoti:
      server:
        autoexplain: DEBUG
```

### Spring AI

Set Spring AI logging to DEBUG level in the logback configuration file.

Add the following to the logback configuration:

```xml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
<logger name="org.springframework.ai" level="DEBUG"/>
```

### Visualize This

Set Visualize This logging to DEBUG level in the application configuration file.

Add the following to `application.yaml`:

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
logging:
  level:
    atoti:
      server:
        chat: DEBUG
```

## OpenTelemetry metrics

Atoti Server exposes OpenTelemetry metrics for AI and chat features (`atoti.ai.chat.*`), covering prompt execution, conversations, and tool calls. These metrics can be collected using any OpenTelemetry-compatible backend. In addition, Spring AI provides its own metrics and traces for model interactions, which are automatically available when OpenTelemetry is configured.

For the full metrics reference, see [Metrics](https://docs.activeviam.com/products/atoti/server/latest/docs/monitoring/metrics) in the Atoti Server documentation.

To configure OpenTelemetry collection, see [How to set up observability with OpenTelemetry](https://docs.activeviam.com/products/atoti/server/latest/docs/monitoring/otel_how_to) in the Atoti Server documentation.

## Common pitfalls

### Context path

When the application runs under a context path, the MCP server requires an explicit base URL to resolve correctly.

Add the following to `application.yaml`:

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
spring:
  ai:
    mcp:
      server:
        base-url: ${context_path}
```

### Keep-alive

Some third-party applications drop the connection to the MCP server after a period of inactivity.
Configuring a keep-alive interval causes the server to send periodic pings to the client,
preventing the connection from timing out.

Add the following to `application.yaml`:

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
spring:
  ai:
    mcp:
      server:
        keep-alive-interval: 30s
```

<Info>
  A shorter interval sends pings more frequently and reduces the chance of a timeout.
  A longer interval reduces network overhead but increases the risk of the connection dropping
  between pings.
</Info>

## Related reading

* [Atoti MCP server setup](./mcp-server/setup/atoti-mcp-server-setup)
* [How to set up Auto-Explain](./enable-ai-tools/atoti-java-sdk/auto-explain/setup)
* [How to set up Visualize This](./enable-ai-tools/atoti-java-sdk/chat/setup)
* [Metrics](https://docs.activeviam.com/products/atoti/server/latest/docs/monitoring/metrics) — full list of Atoti Server metrics, including AI-specific chat metrics
* [How to set up observability with OpenTelemetry](https://docs.activeviam.com/products/atoti/server/latest/docs/monitoring/otel_how_to)
