Skip to content
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-6282] [EDU-6281] refactor: add new Consumption dataset to GraphQL API existing docs #1529

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Four datasets are deprecated and were replaced by other datsets:
| botManagerMetrics | Query the number of requests evaluated and the actions performed by [Azion Bot Manager](/en/documentation/products/guides/query-bot-manager-data-with-graphql/) (if subscribed) |
| botManagerBreakdownMetrics | Query the URLs most impacted by bad bots, according to [Azion Bot Manager](/en/documentation/products/guides/query-bot-manager-breakdown-data-with-graphql/) data (if subscribed) |

<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-real-time-metrics-fields/" label="see Real-Time Metrics GraphQL API fields descriptions" severity="secondary" />
<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-real-time-metrics-fields/" label="Go to Real-Time Metrics GraphQL API fields descriptions" severity="secondary" />

### Real-Time Events GraphQL API

Expand All @@ -68,7 +68,7 @@ Four datasets are deprecated and were replaced by other datsets:
| telemetryDeviceInfoEvents | Events related to the device being used for access and recorded by **Azion Mobile SDK**, both at the hardware and software levels. |
| telemetrySensorsEvents | Events related to the device's sensors recorded by **Azion Mobile SDK**, such as touchscreen interactions and gyroscope information. |

<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-real-time-events-fields/" label="see Real-Time Events GraphQL API fields descriptions" severity="secondary" />
<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-real-time-events-fields/" label="Go to Real-Time Events GraphQL API fields descriptions" severity="secondary" />

### Billing GraphQL API

Expand All @@ -81,15 +81,23 @@ The Billing GraphQL API is only available for *Online Sales* accounts.
| balanceFinancialEntry | Logs regarding types of financial entries and monetary values |
| paymentsClientDebt | Logs regarding client's debts and payments and monetary values |

<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-billing-fields/" label="see Billing GraphQL API fields descriptions" severity="secondary" />
<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-billing-fields/" label="Go to Billing GraphQL API fields descriptions" severity="secondary" />

### Accounting GraphQL API

| Dataset | Description |
| ------- | ----------- |
| accountingDetail | Logs regarding accounted data for products and its metrics |

<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-accounting-fields/" label="see Accounting GraphQL API fields descriptions" severity="secondary" />
<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-accounting-fields/" label="Go to Accounting GraphQL API fields descriptions" severity="secondary" />

### Consumption GraphQL API

| Dataset | Description |
| ------- | ----------- |
| `workloadConsumptionMetrics` | Logs regarding accounted data for products usage and their metrics |

<LinkButton link="/en/documentation/devtools/graphql-api/features/gql-consumption-fields/" label="Go to Consumption GraphQL API fields descriptions" severity="secondary" />

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Real-Time Metrics GraphQL API Fields
description: >-
Explore comprehensive insights on Real-Time Metrics and GraphQL API
datasetswith detailed field descriptions for Edge Applications on Azion
datasets with detailed field descriptions for Edge Applications on Azion
Console.
permalink: /documentation/devtools/graphql-api/features/gql-real-time-metrics-fields/
meta_tags: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ After creating your personal token, head to the API platform you'll be using and
- To use the Real-Time Events API for raw data, include: `https://api.azionapi.net/events/graphql`
- To use the Billing API for financial data, include: `https://api.azionapi.net/billing/graphql`
- To use the Accounting API for financial data, include: `https://api.azionapi.net/accounting/graphql`
- To use the Consumption API for usage data, include: `https://api.azionapi.net/consumption/graphql`

---

Expand All @@ -49,6 +50,7 @@ After successfully logging in to **Azion Console**, go to one of the links:
- `https://manager.azion.com/events/graphql`
- `https://manager.azion.com/billing/graphql`
- `https://manager.azion.com/accounting/graphql`
- `https://manager.azion.com/consumption/graphql`

Feel free to interact with the GraphQL API playground.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ You can use the two Azion GraphQL APIs to perform a logpull of your data and max
You can also use the financial GraphQL APIs:

- [Billing GraphQL API](/en/documentation/products/accounts/billing-and-subscriptions/), which provides data related to bills, type of financial entries, and payments.
- **Accounting GraphQL API**, which provides data related to products and its metrics being accounted in the client's account.
- [Accounting GraphQL API](/en/documentation/devtools/graphql-api/features/gql-accounting-fields/), which provides data related to products and its metrics being accounted in the client's account.
- [Consumption GraphQL API](/en/documentation/devtools/graphql-api/features/gql-consumption-fields/), which provides data related to products' usage and their metrics being accounted in the client’s account.

With the Real-Time Metrics GraphQL API, you can, for example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,89 @@ To query financial data, it’s mandatory to inform:

Different from a raw and an aggregated query, you'll use the `periodFrom` and `periodTo` fields to filter a time range.

### Usage data

Usage data exhibit information as accounted data.

Here’s an example of usage data for Image Processor using Consumption GraphQL API query:

```graphql
query {
workloadConsumptionMetrics(
filter: {
tsRange: {
begin: "2025-02-01T00:00:00",
end: "2025-03-01T00:00:00",
}
productId: 1441110021
metricName: "images_processed"
}
aggregate: {
sum: accounted
}
limit: 10000
groupBy: [clientId, workloadId, productId, metricName]
) {
clientId
workloadId
productId
metricName
total: sum
}
}
```

And the response to the query:

```json
{
"data": {
"workloadConsumptionMetrics": [
{
"clientId": "0000z",
"workloadId": 4829103746,
"productId": 1441110021,
"metricName": "images_processed",
"total": 32
},
{
"clientId": "0000z",
"workloadId": 1938475620,
"productId": 1441110021,
"metricName": "images_processed",
"total": 19478
},
{
"clientId": "0000z",
"workloadId": 7584931026,
"productId": 1441110021,
"metricName": "images_processed",
"total": 299612
},
{
"clientId": "0000z",
"workloadId": 6203849175,
"productId": 1441110021,
"metricName": "images_processed",
"total": 1432
},
{
"clientId": "0000z",
"workloadId": 3948571023,
"productId": 1441110021,
"metricName": "images_processed",
"total": 268675
}
]
}
}
```

To query usage data, it's mandatory to inform:

Which consulted data should be exhibited. On the presented example, the `accounted`, `clientId`, `workloadId`, `productId`, and `metricName` were used.


---

## Operators
Expand Down Expand Up @@ -406,4 +489,4 @@ Depending on the [type of field of a dataset](/en/documentation/devtools/graphql
Discover the essential role of operators in GraphQL queries. Watch the video below:
<div class="cms-embed">
<iframe width="600" height="400" src="https://www.youtube.com/embed/OGam-xrzuBA?si=cg-SIvWH8OedkrtY" loading="lazy" title="Operators in GraphQL for Real Time Event Queries" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Após criar o seu personal token, vá para a plataforma de API de sua escolha e
- Para usar a API Real-Time Events com dados brutos, inclua: `https://api.azionapi.net/events/graphql`
- Para usar a API Billing com dados financeiros, inclua: `https://api.azionapi.net/billing/graphql`
- Para usar a API Accounting com dados financeiros, inclua: `https://api.azionapi.net/accounting/graphql`
- Para usar a API Consumption com dados de uso dos produtos, inclua: `https://api.azionapi.net/consumption/graphql`

---

Expand All @@ -55,6 +56,7 @@ Após fazer login no **Console**, acesse um dos links:
- `https://manager.azion.com/events/graphql`
- `https://manager.azion.com/billing/graphql`
- `https://manager.azion.com/accounting/graphql`
- `https://manager.azion.com/consumption/graphql`

Interaja com o playground da GraphQL API livremente.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,86 @@ Para consultar os dados financeiros, é obrigatório informar:

Diferente de uma query bruta e uma agregada, você utilizará os campos `periodFrom` e `periodTo` para filtrar um intervalo de tempo.

## Dados de uso

Os dados de uso exibem informações contabilizadas.

Aqui está um exemplo de dados de uso do Image Processor usando uma query da API GraphQL de Consumption:

```graphql
query {
workloadConsumptionMetrics(
filter: {
tsRange: {
begin: "2025-02-01T00:00:00",
end: "2025-03-01T00:00:00",
}
productId: 1441110021
metricName: "images_processed"
}
aggregate: {
sum: accounted
}
limit: 10000
groupBy: [clientId, workloadId, productId, metricName]
) {
clientId
workloadId
productId
metricName
total: sum
}
}
```

E a resposta da query:

```json
{
"data": {
"workloadConsumptionMetrics": [
{
"clientId": "0000z",
"workloadId": 4829103746,
"productId": 1441110021,
"metricName": "images_processed",
"total": 32
},
{
"clientId": "0000z",
"workloadId": 1938475620,
"productId": 1441110021,
"metricName": "images_processed",
"total": 19478
},
{
"clientId": "0000z",
"workloadId": 7584931026,
"productId": 1441110021,
"metricName": "images_processed",
"total": 299612
},
{
"clientId": "0000z",
"workloadId": 6203849175,
"productId": 1441110021,
"metricName": "images_processed",
"total": 1432
},
{
"clientId": "0000z",
"workloadId": 3948571023,
"productId": 1441110021,
"metricName": "images_processed",
"total": 268675
}
]
}
}
```

Para consultar os dados de uso, é obrigatório informar quais dados consultados devem ser exibidos. No exemplo apresentado, foram utilizados `accounted`, `clientId`, `workloadId`, `productId` e `metricName`.

---

## Operadores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ A Billing GraphQL API está disponível apenas para contas do tipo *Online Sales

<LinkButton link="/pt-br/documentacao/devtools/graphql-api/recursos/campos-gql-accounting/" label="veja as descrições dos Campos da API GraphQL de Accounting" severity="secondary" />

### Consumption GraphQL API

| Conjunto de dados | Descrição |
| ----------------- | --------- |
| workloadConsumptionMetrics | Logs relativos aos dados contabilizados para uso dos produtos e suas métricas |

<LinkButton link="/pt-br/documentacao/devtools/graphql-api/recursos/campos-gql-consumption/" label="Veja as descrições dos campos da API GraphQL de Consumption " severity="secondary" />

---

:::tip[dica]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Você pode utilizar as duas APIs GraphQL da Azion para fazer um logpull de seus
Você também pode usar as APIs GraphQL financeiras:

- [API GraphQL de Billing](/pt-br/documentacao/produtos/gestao-de-contas/billing-and-subscriptions/), que fornece dados relacionados às contas de faturamento, tipos de entradas financeiras e pagamentos.
- **API GraphQL de Accounting**, que fornece dados relacionados a produtos e suas métricas sendo contabilizadas na conta do cliente.
- [API GraphQL de Accounting](/pt-br/documentacao/devtools/graphql-api/recursos/campos-gql-accounting/), que fornece dados relacionados a produtos e suas métricas sendo contabilizadas na conta do cliente.
- [API GraphQL de Consumption](/pt-br/documentacao/devtools/graphql-api/recursos/campos-gql-consumption/), que fornece dados relacionados ao uso dos produtos e suas métricas que estão sendo contabilizadas na conta do cliente.

Com a API GraphQL do Real-Time Metrics, você pode, por exemplo:

Expand Down