Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
title: Basic troubleshooting on Azion Web Platform
description: Learn how to enable Debug Rules, use Real-Time Events, and query data with GraphQL to understand why specific actions were applied to your requests.
meta_tags: >-
real time, edge computing, observe, observability, metrics, data, events,
security, troubleshooting
namespace: docs_basic_troubleshooting
permalink: /documentation/products/guides/basic-troubleshooting/
---

Use this guide to troubleshoot your application on the Azion Web Platform. Learn how to enable Debug Rules, use Real-Time Events, and query data with GraphQL to understand why specific actions were applied to your requests. This guide includes a practical example that shows how to identify which rules were executed and why a request was blocked.

## Enabling Debug Rules

Debug Rules can be enabled in both **Applications** and **Firewall**. They show which rules were executed for a request and the actions those rules took (blocking is just one example), helping you understand why a specific action was applied.

To enable Debug Rules for Applications:

1. Access [Console](https://console.azion.com).
2. Go to **Products menu** > **Applications**.
3. Select an existing application to activate debug.
4. On the **Main Settings** tab, enable the **Debug Rules** option.
5. Click the **Save** button.

To enable Debug Rules for Firewalls:

1. Access [Console](https://console.azion.com).
2. Go to **Products menu** > **Firewalls**.
3. Select the firewall you want to configure.
4. On the **Main Settings** tab, enable the **Debug Rules** option.
5. Click the **Save** button.

### Real time Events

To access Real-Time Events, follow these steps:

1. Access [Console](https://console.azion.com).
2. On the upper-left corner, select **Products menu** > **Real-Time Events**.
3. Select the **HTTP Requests** tab.
4. Modify the desired time range and filters.
5. Click the **Search** button.

### GraphQL

To access the Azion **GraphQL** built-in playground accessible via the Real Time Events menu, or by [visiting this link](https://api.azion.com/v4/events/graphql#query=query%20(%0A%09%24tsRange_begin%3A%20DateTime!%0A%09%24tsRange_end%3A%20DateTime!%0A)%20%7B%0A%09httpEvents%20(%0A%09%09limit%3A%2010%0A%09%09orderBy%3A%20%5Bts_DESC%5D%0A%09%09filter%3A%20%7B%0A%09%09%09tsRange%3A%20%7B%20begin%3A%20%24tsRange_begin%2C%20end%3A%20%24tsRange_end%20%7D%0A%09%09%09%23hostEq%3A%20%0A%09%09%09%23statusEq%3A%0A%20%20%20%20%20%20%23requestIdEq%3A%22%22%0A%09%09%7D%0A%09)%20%7B%0A%20%20%20%20ts%0A%20%20%20%20requestId%0A%09%09%23configurationId%0A%09%09host%0A%09%09%23requestMethod%0A%09%09status%0A%20%20%20%20upstreamStatus%0A%20%20%20%20%23upstreamResponseTime%0A%09%09%23upstreamBytesSent%0A%09%09%23sslProtocol%0A%09%09%23wafLearning%0A%09%09%23requestTime%0A%09%09%23serverProtocol%0A%09%09upstreamCacheStatus%0A%09%09%23httpReferer%0A%09%09remoteAddress%0A%20%20%20%20stacktrace%0A%09%09wafMatch%0A%09%09%23serverPort%0A%09%09%23sslCipher%0A%09%09wafEvheaders%0A%09%09%23serverAddr%0A%09%09%23scheme%0A%20%20%20%20httpUserAgent%0A%20%20%20%20%0A%09%7D%0A%7D&variables=%7B%22tsRange_begin%22%3A%222026-01-29T12%3A00%3A00%22%2C%22tsRange_end%22%3A%222026-01-29T13%3A59%3A59%22%7D).


:::tip
Check the [GraphQL API documentation](/en/documentation/devtools/graphql-api/overview/) for more information.
:::

By default, all requests are logged using the UTC time zone.

## A practical example

For this example we will use a sample application in which when you access the `/block` URI it the request will be blocked with a `403` status.

So if you tried to access the site you will get a 403 error page that looks like this:

![Azion Error page](/assets/docs/images/troubleshooting-guides/basic-troubleshoot-error.png)

How can you find out exactly why this request was blocked?

For the steps below, copy the **Request ID** displayed on the page.

### In Real Time Events

1. Access Real Time Events
2. Filter by the request id you copied.
3. Select the log body.
4. Look for the **stacktrace** field.

You'll see a response similar to this:

```json
{
"edge_application_request": [
"Default Rule",
"block"
]
}
```

The `stacktrace` field tells you that the Application rule named `block` was executed.

### In GraphQL Playground

1. Access the GraphQL Playground
2. Run the query below, replacing the `tsRange` and `requestIdEq` fields with the correct values.


```graphql
query (
$tsRange_begin: DateTime!
$tsRange_end: DateTime!
) {
httpEvents (
limit: 10
orderBy: [ts_DESC]
filter: {
tsRange: { begin: $tsRange_begin, end: $tsRange_end }
#hostEq:
#statusEq:
#requestIdEq:""
}
) {
ts
requestId
#configurationId
host
#requestMethod
status
upstreamStatus
#upstreamResponseTime
#upstreamBytesSent
#sslProtocol
#wafLearning
#requestTime
#serverProtocol
upstreamCacheStatus
#httpReferer
remoteAddress
stacktrace
wafMatch
#serverPort
#sslCipher
wafEvheaders
#serverAddr
#scheme
httpUserAgent

}
}
```

You`ll get a response similar to this:

```json

"data": {
"httpEvents": [
{
"configurationId": "xxx",
"host": "xxxxx.azionedge.net",
"requestId": "your_request_id_here",
"httpUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15",
"requestMethod": "GET",
"status": 403,
"ts": "2026-01-22T21:10:38Z",
"stacktrace": "{\\\"edge_application_request\\\":[\\\"Default Rule\\\",\\\"block\\\"]}",
"upstreamBytesSent": 0,
"sslProtocol": "TLSv1.3",
"wafLearning": "-",
"requestTime": "0",
"serverProtocol": "HTTP/2.0",
"upstreamCacheStatus": "-",
"httpReferer": "-",
"remoteAddress": "xxxx",
"wafMatch": "-",
"serverPort": "443",
"sslCipher": "TLS_AES_256_GCM_SHA384",
"wafEvheaders": "-",
"serverAddr": "179.191.174.11",
"scheme": "https"
},
```

The `stacktrace` field tells you that the Application rule named `block` was executed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
title: Basic troubleshooting on Azion Web Platform
description: Learn how to enable Debug Rules, use Real-Time Events, and query data with GraphQL to understand why specific actions were applied to your requests.
meta_tags: >-
real time, edge computing, observe, observability, metrics, data, events,
security, troubleshooting
namespace: docs_basic_troubleshooting
permalink: /documentacao/produtos/guias/investigacao-problemas-basico/
---

Use este guia para identificar comportamentos inesperados em aplicações na Azion Web Platform. Aprenda como habilitar Debug Rules, usar Real-Time Events e consultar dados com GraphQL para entender por que ações específicas foram aplicadas às suas requisições. Este guia inclui um exemplo prático que mostra como identificar quais regras foram executadas e por que uma requisição foi bloqueada.

## Habilitando Debug Rules

Debug Rules podem ser habilitadas tanto em **Applications** quanto em **Firewall**. Elas mostram quais regras foram executadas para uma requisição e as ações que essas regras tomaram (bloquear é apenas um exemplo), ajudando você a entender por que uma ação específica foi aplicada.

Para habilitar Debug Rules para Applications:

1. Acesse o [Console](https://console.azion.com).
2. Vá para o **Products menu** > **Applications**.
3. Selecione uma aplicação existente para ativar o debug.
4. Na aba **Main Settings**, habilite a opção **Debug Rules**.
5. Clique no botão **Save**.

Para habilitar Debug Rules para Firewalls:

1. Acesse o [Console](https://console.azion.com).
2. Vá para o **Products menu** > **Firewalls**.
3. Selecione o firewall que você deseja configurar.
4. Na aba **Main Settings**, habilite a opção **Debug Rules**.
5. Clique no botão **Save**.


### Real time Events

Para acessar o Real-Time Events, siga estes passos:

1. Acesse o [Console](https://console.azion.com).
2. No canto superior esquerdo, selecione **Products menu** > **Real-Time Events**.
3. Selecione a aba **HTTP Requests**.
4. Modifique o intervalo de tempo desejado e os filtros.
5. Clique no botão **Search**.

### GraphQL

Para acessar o playground Azion **GraphQL**, acessível através do menu Real Time Events, ou [visitando este link](https://api.azion.com/v4/events/graphql#query=query%20(%0A%09%24tsRange_begin%3A%20DateTime!%0A%09%24tsRange_end%3A%20DateTime!%0A)%20%7B%0A%09httpEvents%20(%0A%09%09limit%3A%2010%0A%09%09orderBy%3A%20%5Bts_DESC%5D%0A%09%09filter%3A%20%7B%0A%09%09%09tsRange%3A%20%7B%20begin%3A%20%24tsRange_begin%2C%20end%3A%20%24tsRange_end%20%7D%0A%09%09%09%23hostEq%3A%20%0A%09%09%09%23statusEq%3A%0A%20%20%20%20%20%20%23requestIdEq%3A%22%22%0A%09%09%7D%0A%09)%20%7B%0A%20%20%20%20ts%0A%20%20%20%20requestId%0A%09%09%23configurationId%0A%09%09host%0A%09%09%23requestMethod%0A%09%09status%0A%20%20%20%20upstreamStatus%0A%20%20%20%20%23upstreamResponseTime%0A%09%09%23upstreamBytesSent%0A%09%09%23sslProtocol%0A%09%09%23wafLearning%0A%09%09%23requestTime%0A%09%09%23serverProtocol%0A%09%09upstreamCacheStatus%0A%09%09%23httpReferer%0A%09%09remoteAddress%0A%20%20%20%20stacktrace%0A%09%09wafMatch%0A%09%09%23serverPort%0A%09%09%23sslCipher%0A%09%09wafEvheaders%0A%09%09%23serverAddr%0A%09%09%23scheme%0A%20%20%20%20httpUserAgent%0A%20%20%20%20%0A%09%7D%0A%7D&variables=%7B%22tsRange_begin%22%3A%222026-01-29T12%3A00%3A00%22%2C%22tsRange_end%22%3A%222026-01-29T13%3A59%3A59%22%7D).


:::tip
Consulte a [documentação da API GraphQL](/pt-br/documentacao/devtools/graphql-api/visao-geral/) para mais informações.
:::

Por padrão, todas as requisições são registradas usando o fuso horário UTC.

## Um exemplo prático

Para este exemplo, usaremos uma aplicação de amostra na qual, ao acessar a URI `/block`, a requisição será bloqueada com um status `403`.
Portanto, se você tentasse acessar o site, receberia uma página de erro 403 parecida com esta:

![Página de erro da Azion](/assets/docs/images/troubleshooting-guides/basic-troubleshoot-error.png)

Como você pode descobrir exatamente por que essa requisição foi bloqueada?

Para os passos abaixo, copie o **Request ID** exibido na página.

### No Real Time Events
1. Acesse o Real Time Events
2. Filtre pelo request id que você copiou.
3. Selecione o corpo do log.
4. Procure pelo campo **stacktrace**.

Você verá uma resposta semelhante a esta:

```json
{
"edge_application_request": [
"Default Rule",
"block"
]
}
```

O campo `stacktrace` informa que a regra de Application chamada `block` foi executada.

### No GraphQL Playground

1.Acesse o GraphQL Playground.
2.Execute a query abaixo, substituindo os campos `tsRange` e `requestIdEq` pelos valores corretos.

```graphql
query (
$tsRange_begin: DateTime!
$tsRange_end: DateTime!
) {
httpEvents (
limit: 10
orderBy: [ts_DESC]
filter: {
tsRange: { begin: $tsRange_begin, end: $tsRange_end }
#hostEq:
#statusEq:
#requestIdEq:""
}
) {
ts
requestId
#configurationId
host
#requestMethod
status
upstreamStatus
#upstreamResponseTime
#upstreamBytesSent
#sslProtocol
#wafLearning
#requestTime
#serverProtocol
upstreamCacheStatus
#httpReferer
remoteAddress
stacktrace
wafMatch
#serverPort
#sslCipher
wafEvheaders
#serverAddr
#scheme
httpUserAgent

}
}
```

Você receberá uma resposta semelhante a esta:

```json

"data": {
"httpEvents": [
{
"configurationId": "xxx",
"host": "xxxxx.azionedge.net",
"requestId": "your_request_id_here",
"httpUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15",
"requestMethod": "GET",
"status": 403,
"ts": "2026-01-22T21:10:38Z",
"stacktrace": "{\\\"edge_application_request\\\":[\\\"Default Rule\\\",\\\"block\\\"]}",
"upstreamBytesSent": 0,
"sslProtocol": "TLSv1.3",
"wafLearning": "-",
"requestTime": "0",
"serverProtocol": "HTTP/2.0",
"upstreamCacheStatus": "-",
"httpReferer": "-",
"remoteAddress": "xxxx",
"wafMatch": "-",
"serverPort": "443",
"sslCipher": "TLS_AES_256_GCM_SHA384",
"wafEvheaders": "-",
"serverAddr": "179.191.174.11",
"scheme": "https"
},
```

O campo `stacktrace` informa que a regra de Application chamada `block` foi executada.