-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EDU-5581] [EDU-5582] [EDU-5590] feature: add documentation related to the httpBreakdownMetrics dataset #1348
Open
MarianaAguilera
wants to merge
17
commits into
main
Choose a base branch
from
edu-5581-httpBreakdownMetrics-dataset-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dbd8a38
feature: add item in GraphQL features file EN
MarianaAguilera 6bdc826
feature: add table to Metrics Fields file EN
MarianaAguilera ac918bf
feature: add query guide EN
MarianaAguilera 167b18f
refactor: reorganize order
MarianaAguilera 8fa6524
feature: add link to Guides page and menu
MarianaAguilera 1ee90df
fix: broken url
MarianaAguilera 7694d21
feature: add query guide PT
MarianaAguilera 9ece666
Update httpBreakdownMetrics-dataset.mdx
MarianaAguilera 7dcfc27
fix: adjust code block
MarianaAguilera b8dc0d9
feature: add link to Guides page and menu
MarianaAguilera ddc1bee
feature: add in GQL features PT
MarianaAguilera 7ee6df5
feature: add table to Metrics Fields file PT
MarianaAguilera f48f3d5
fix: add note and adjust time
MarianaAguilera d68a247
Update src/content/docs/en/pages/guides/graphql/httpBreakdownMetrics-…
MarianaAguilera fafa419
Merge branch 'main' into edu-5581-httpBreakdownMetrics-dataset-docs
MarianaAguilera 8aaaa27
feature: add item to Release Notes page - EN/PT
MarianaAguilera 25e7f10
Merge branch 'main' into edu-5581-httpBreakdownMetrics-dataset-docs
MarianaAguilera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
src/content/docs/en/pages/guides/graphql/httpBreakdownMetrics-dataset.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
--- | ||
title: How to query data from the httpBreakdownMetrics dataset | ||
description: This guide will explain how to query data from the httpBreakdownMetrics dataset using the GraphiQL playground. | ||
meta_tags: graphql, graphql playground, security metrics, edge applications, requests | ||
namespace: docs_guides_query_httpBreakdownMetrics_graphql | ||
permalink: /documentation/products/guides/query-httpbreakdownmetrics-data-with-graphql/ | ||
menu_namespace: graphqlMenu | ||
--- | ||
|
||
The **httpBreakdownMetrics** dataset provides real-time, detailed, aggregated data on HTTP request events blocked. This dataset is part of the Real-Time Metrics GraphQL. | ||
|
||
This data is retained and available for up to *90* days. | ||
|
||
This guide will explain how to query data from the httpBreakdownMetrics dataset using the GraphiQL playground. | ||
|
||
--- | ||
|
||
## Querying data | ||
|
||
This example queries the top 20 blocked `remoteAddress` entries. To know more about the available fields, check the [Real-Time Metrics GraphQL API Fields](/en/documentation/devtools/graphql-api/features/gql-real-time-metrics-fields/) documentation. | ||
|
||
:::note | ||
The dataset is based on a 50% sample of the data, meaning values are approximate. | ||
::: | ||
|
||
1. Access the GraphiQL playground in this link: `https://manager.azion.com/metrics/graphql`. | ||
- You must be logged in to your Azion account. Otherwise, you'll receive an error message. | ||
2. Send a query following this format: | ||
|
||
```graphql | ||
query { | ||
httpBreakdownMetrics( | ||
aggregate: { sum: blockedRequests } | ||
groupBy: [remoteAddress] | ||
orderBy: [sum_DESC], | ||
limit: 20, | ||
filter: { | ||
tsGte: "2024-10-21T11:00:00" | ||
tsLt: "2024-10-21T12:00:00" | ||
} | ||
) { | ||
remoteAddress | ||
totalBlocked: sum | ||
} | ||
} | ||
``` | ||
|
||
Where: | ||
|
||
| Field | Description | | ||
|----------|----------| | ||
| `sum: blockedRequests` | Returns the total number of requests blocked within the specified time range, after applying any filters | | ||
| `groupBy` | Specifies the fields by which the query results should be grouped. Example: `[remoteAddress]` | | ||
| `orderBy` | Specifies the order in which the results should be returned. Examples: `[sum_DESC]`, for descending order, and `[sum_ASC]`, for ascending order | | ||
| `limit` | Specifies the maximum number of results to return. Example: `20` for retrieving the top 20. System maximum: | | ||
| `filter` | Defines the criteria used to filter the data returned by the query | | ||
| `tsGte` | A subfield of `filter`. Specifies the start time (greater than or equal to) for the data query, ensuring results include records from this timestamp onward. Format: "YYYY-MM-DDTHH:mm:ss"; example: `"2024-10-21T11:00:00"` | | ||
| `tsLt` | A subfield of `filter`. Specifies the end time (less than) for the data query, filtering out any records with timestamps equal to or after this timestamp. Format: "YYYY-MM-DDTHH:mm:ss"; example: `"2024-10-21T12:00:00"` | | ||
|
||
3. You'll receive a response similar to this: | ||
|
||
```graphql | ||
{ | ||
"data": { | ||
"httpBreakdownMetrics": [ | ||
{ | ||
"remoteAddress": "192.168.0.1", | ||
"totalBlocked": 6732 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.0.2", | ||
"totalBlocked": 5872 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.0.3", | ||
"totalBlocked": 3958 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.1.4", | ||
"totalBlocked": 3952 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.1.5", | ||
"totalBlocked": 3806 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.1.6", | ||
"totalBlocked": 3730 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.2.7", | ||
"totalBlocked": 3378 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.2.8", | ||
"totalBlocked": 3318 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.2.9", | ||
"totalBlocked": 3284 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.3.10", | ||
"totalBlocked": 3282 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.3.11", | ||
"totalBlocked": 2958 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.3.12", | ||
"totalBlocked": 2884 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.4.13", | ||
"totalBlocked": 2530 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.4.14", | ||
"totalBlocked": 2348 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.4.15", | ||
"totalBlocked": 2004 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.5.16", | ||
"totalBlocked": 1902 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.5.17", | ||
"totalBlocked": 1538 | ||
}, | ||
{ | ||
"remoteAddress": "172.16.5.18", | ||
"totalBlocked": 1440 | ||
}, | ||
{ | ||
"remoteAddress": "192.168.6.19", | ||
"totalBlocked": 1390 | ||
}, | ||
{ | ||
"remoteAddress": "10.0.6.20", | ||
"totalBlocked": 1314 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
Where: | ||
|
||
| Field | Description | | ||
|----------|----------| | ||
| `remoteAddress` | Specifies the IP address of the source making the request. Example: `10.0.6.20` | | ||
| `totalBlocked` | Refers to the total number of times request from this IP address has been blocked. This field is the result of a sum. Example: `1314` | | ||
MarianaAguilera marked this conversation as resolved.
Show resolved
Hide resolved
MarianaAguilera marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm if we have a system max for this field, @brunomrpx ?