Querying Privacy Gateway Metrics
Privacy Gateway now supports enhanced monitoring through our GraphQL API, providing detailed insights into your gateway traffic and performance. To access these metrics, ensure you have:
- A relay gateway proxy implementation where Cloudflare acts as the oblivious relay party.
- An API token with Analytics Read permissions.
We offer two GraphQL nodes to retrieve metrics:
ohttpMetricsAdaptive
andohttpMetricsAdaptiveGroups
. The first node provides comprehensive request data, while the second facilitates grouped analytics.
ohttpMetricsAdaptive
The ohttpMetricsAdaptive
node is designed for detailed insights into individual OHTTP requests with adaptive sampling. This node can help in understanding the performance and load on your server and client setup.
Key Arguments
filter
- Apply filters to narrow down your data set.
accountTag
is a required filter.
- Apply filters to narrow down your data set.
limit
- Specify the maximum number of records to return.
orderBy
- Choose how to sort your data, with options for various dimensions and metrics.
Available Fields
bytesToClient
int
- The number of bytes returned to the client.
bytesToGateway
int
- Total bytes received from the client.
colo
string
- Airport code of the Cloudflare data center that served the request.
datetime
Time
- The date and time when the event was recorded.
gatewayStatusCode
int
- Status code returned by the gateway.
relayStatusCode
int
- Status code returned by the relay.
This node is useful for a granular view of traffic, helping you identify patterns, performance issues, or anomalies in your data flow.
ohttpMetricsAdaptiveGroups
The ohttpMetricsAdaptiveGroups
node allows for aggregated analysis of OHTTP request metrics with adaptive sampling. This node is particularly useful for identifying trends and patterns across different dimensions of your traffic and operations.
Key Arguments
filter
- Apply filters to narrow down your data set.
accountTag
is a required filter.
- Apply filters to narrow down your data set.
limit
- Specify the maximum number of records to return.
orderBy
- Choose how to sort your data, with options for various dimensions and metrics.
Available Fields
count
int
- The number of records that meet the criteria.
dimensions
- Specifies the grouping dimensions for your data.
sum
- Aggregated totals for various metrics, per dimension.
Dimensions
You can group your metrics by various dimensions to get a more segmented view of your data:
colo
string
- The airport code of the Cloudflare data center.
date
Date
- The date of OHTTP request metrics.
datetimeFifteenMinutes
Time
- Timestamp truncated to fifteen minutes.
datetimeFiveMinutes
Time
- Timestamp truncated to five minutes.
datetimeHour
Time
- Timestamp truncated to the hour.
datetimeMinute
Time
- Timestamp truncated to the minute.
endpoint
string
- The appId that generated traffic.
gatewayStatusCode
int
- Status code returned by the gateway.
relayStatusCode
int
- Status code returned by the relay.
Sum Fields
Sum fields offer a cumulative view of various metrics over your selected time period:
bytesToClient
int
- Total bytes sent from the gateway to the client.
bytesToGateway
int
- Total bytes from the client to the gateway.
clientRequestErrors
int
- Total number of client request errors.
gatewayResponseErrors
int
- Total number of gateway response errors.
Utilize the ohttpMetricsAdaptiveGroups node to gain comprehensive, aggregated insights into your traffic patterns, helping you optimize performance and user experience.