Skip to content

Commit 2d299cc

Browse files
committed
Added graphql examples
1 parent 8e51fbc commit 2d299cc

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

src/content/docs/pipelines/observability/metrics.mdx

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,61 @@ sidebar:
66

77
---
88

9-
TODO
9+
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.
10+
11+
To learn more about the GraphQL Analytics API, refer to [GraphQL Analytics API](/analytics/graphql-api/).
12+
13+
You can use the GraphQL API to measure metrics for data ingested, as well as data delivered.
14+
15+
## Write GraphQL queries
16+
17+
Examples of how to explore your Pipelines metrics.
18+
19+
### Measure total bytes & records ingested over time period
20+
21+
```graphql
22+
query PipelineIngestion($accountTag: string!, $pipelineId: string!, $datetimeStart: Time!, $datetimeEnd: Time!) {
23+
viewer {
24+
accounts(filter: {accountTag: $accountTag}) {
25+
pipelinesIngestionAdaptiveGroups(
26+
limit: 10000
27+
filter: {
28+
pipelineId: $pipelineId
29+
datetime_geq: $datetimeStart
30+
datetime_leq: $datetimeEnd
31+
}
32+
33+
)
34+
{
35+
sum {
36+
ingestedBytes,
37+
ingestedRecords,
38+
}
39+
}
40+
}
41+
}
42+
}
43+
```
44+
45+
### Measure volume of data delivered
46+
47+
```graphql
48+
query PipelineDelivery($accountTag: string!, $queueId: string!, $datetimeStart: Time!, $datetimeEnd: Time!) {
49+
viewer {
50+
accounts(filter: {accountTag: $accountTag}) {
51+
pipelinesDeliveryAdaptiveGroups(
52+
limit: 10000
53+
filter: {
54+
pipelineId: $queueId
55+
datetime_geq: $datetimeStart
56+
datetime_leq: $datetimeEnd
57+
}
58+
) {
59+
sum {
60+
deliveredBytes,
61+
}
62+
}
63+
}
64+
}
65+
}
66+
```

0 commit comments

Comments
 (0)