Skip to content

Commit

Permalink
Added graphql examples
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshwarip committed Nov 19, 2024
1 parent 8e51fbc commit 2d299cc
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion src/content/docs/pipelines/observability/metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,61 @@ sidebar:

---

TODO
Pipelines metrics are split across three different nodes under `viewer` > `accounts`. Refer to [Explore the GraphQL schema](/analytics/graphql-api/getting-started/explore-graphql-schema/) to learn how to navigate a GraphQL schema and discover which data are available.

To learn more about the GraphQL Analytics API, refer to [GraphQL Analytics API](/analytics/graphql-api/).

You can use the GraphQL API to measure metrics for data ingested, as well as data delivered.

## Write GraphQL queries

Examples of how to explore your Pipelines metrics.

### Measure total bytes & records ingested over time period

```graphql
query PipelineIngestion($accountTag: string!, $pipelineId: string!, $datetimeStart: Time!, $datetimeEnd: Time!) {
viewer {
accounts(filter: {accountTag: $accountTag}) {
pipelinesIngestionAdaptiveGroups(
limit: 10000
filter: {
pipelineId: $pipelineId
datetime_geq: $datetimeStart
datetime_leq: $datetimeEnd
}

)
{
sum {
ingestedBytes,
ingestedRecords,
}
}
}
}
}
```

### Measure volume of data delivered

```graphql
query PipelineDelivery($accountTag: string!, $queueId: string!, $datetimeStart: Time!, $datetimeEnd: Time!) {
viewer {
accounts(filter: {accountTag: $accountTag}) {
pipelinesDeliveryAdaptiveGroups(
limit: 10000
filter: {
pipelineId: $queueId
datetime_geq: $datetimeStart
datetime_leq: $datetimeEnd
}
) {
sum {
deliveredBytes,
}
}
}
}
}
```

0 comments on commit 2d299cc

Please sign in to comment.