diff --git a/package-lock.json b/package-lock.json index 0bb8dfcfaf..a2e1de9b1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@nanostores/preact": "^0.5.2", "algoliasearch": "^4.22.1", "azion-theme": "^1.15.3", - "azion-webkit": "^1.260.1", + "azion-webkit": "^1.271.5", "canvas-confetti": "^1.6.0", "github-slugger": "^2.0.0", "gray-matter": "^4.0.3", @@ -439,39 +439,6 @@ } } }, - "node_modules/@astrojs/check/node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "dev": true, - "optional": true, - "peer": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/@astrojs/check/node_modules/prettier-plugin-astro": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.14.1.tgz", - "integrity": "sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@astrojs/compiler": "^2.9.1", - "prettier": "^3.0.0", - "sass-formatter": "^0.7.6" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" - } - }, "node_modules/@astrojs/compiler": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.13.0.tgz", @@ -7857,9 +7824,10 @@ "integrity": "sha512-ub1WmhhLn6Sk6lpZPn1WSme68uk/IiBWz8UO+/1e03h5pA6CQuJH5Xvs5A+i0EpOIclHZ2ROaqPRGMWEyOyPJw==" }, "node_modules/azion-webkit": { - "version": "1.260.1", - "resolved": "https://registry.npmjs.org/azion-webkit/-/azion-webkit-1.260.1.tgz", - "integrity": "sha512-bZysHfwIw5C82mQ5EmV+6zApu+3LP6eFcm7UkmV0WXkBcC7QaQdHVIsnbWN+S+F40NTe+9CuIHhLCi/YyOBGxQ==", + "version": "1.277.0", + "resolved": "https://registry.npmjs.org/azion-webkit/-/azion-webkit-1.277.0.tgz", + "integrity": "sha512-giXUpGPm8zWiwSbD2ERYsWH4WeP2azI5STBtVJQNXMRwYskc/wyl1jeamzkRHLBrMezAGpfsCPbKVzpLogt4FQ==", + "license": "MIT", "peerDependencies": { "vue": "^3.0.0" } @@ -18143,15 +18111,6 @@ "node": ">= 6" } }, - "node_modules/pkginfo": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", - "integrity": "sha512-8xCNE/aT/EXKenuMDZ+xTVwkT8gsoHN2z/Q29l80u0ppGEXVvsKRzNMbtKhg8LS8k1tJLAHHylf6p4VFmP6XUQ==", - "extraneous": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/possible-typed-array-names": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", diff --git a/public/assets/docs/images/troubleshooting-guides/basic-troubleshoot-error.png b/public/assets/docs/images/troubleshooting-guides/basic-troubleshoot-error.png new file mode 100644 index 0000000000..14fdaad3f5 Binary files /dev/null and b/public/assets/docs/images/troubleshooting-guides/basic-troubleshoot-error.png differ diff --git a/src/content/docs/en/pages/guides/troubleshooting/basic-troubleshooting.mdx b/src/content/docs/en/pages/guides/troubleshooting/basic-troubleshooting.mdx new file mode 100644 index 0000000000..02e04d597e --- /dev/null +++ b/src/content/docs/en/pages/guides/troubleshooting/basic-troubleshooting.mdx @@ -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. diff --git a/src/content/docs/pt-br/pages/guias/troubleshooting/basic-troubleshooting.mdx b/src/content/docs/pt-br/pages/guias/troubleshooting/basic-troubleshooting.mdx new file mode 100644 index 0000000000..2edda2b243 --- /dev/null +++ b/src/content/docs/pt-br/pages/guias/troubleshooting/basic-troubleshooting.mdx @@ -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.