Skip to content

GraphQL Analytics API

Privacy Proxy exposes metrics through Cloudflare's GraphQL Analytics API. All metrics are queryable through a single endpoint:

POST https://api.cloudflare.com/client/v4/graphql

Before you begin, you will need:

  • API token — Create a token with Account Analytics read permissions. For more information, refer to our Analytics API token documentation: Configure an Analytics API token.
  • Account ID — Your Cloudflare account ID, passed as accountTag in queries. For more information, refer to Find account and zone IDs.

Making a request

The following example shows how to query your Privacy Proxy metrics daily request volume using curl. Replace the placeholder values with your own.

Terminal window
curl https://api.cloudflare.com/client/v4/graphql \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"query": "query DailyRequestVolume($accountTag: String!, $startDate: Date!, $endDate: Date!) { viewer { accounts(filter: { accountTag: $accountTag }) { privacyProxyRequestMetricsAdaptiveGroups(filter: { date_geq: $startDate, date_leq: $endDate }, limit: 10000, orderBy: [date_ASC]) { count dimensions { date } } } } }",
"variables": {
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}
}'

Available nodes

Four GraphQL nodes are available. All four return aggregate data only — no raw per-connection records are exposed.

  1. privacyProxyRequestMetricsAdaptiveGroups — Query aggregate request volume and error rates, filterable by time, location, endpoint, status code, and proxy status dimensions.
  2. privacyProxyIngressConnMetricsAdaptiveGroups — Query client-to-proxy connection counts, bytes transferred, and latency percentiles, filterable by time, location, endpoint, and transport dimensions.
  3. privacyProxyEgressConnMetricsAdaptiveGroups — Query proxy-to-origin connection counts, bytes transferred, and latency percentiles, filterable by time, location, endpoint, and transport dimensions.
  4. privacyProxyAuthMetricsAdaptiveGroups — Query authentication attempt counts, filterable by time, location, endpoint, auth method, and auth result dimensions.

Schema

Metrics

Sum fields

FieldTypeDescriptionNode
bytesSentToClientuint64Total bytes sent from the proxy back to the client.Ingress connection
bytesRecvdFromClientuint64Total bytes received by the proxy from the client.Ingress connection
bytesSentToOriginuint64Total bytes sent from the proxy to the upstream origin.Egress connection
bytesRecvdFromOriginuint64Total bytes received by the proxy from the upstream origin.Egress connection
packetsSentToClientuint64Total packets sent from the proxy back to the client.Ingress connection
packetsRecvdFromClientuint64Total packets received by the proxy from the client.Ingress connection
packetsSentToOriginuint64Total packets sent from the proxy to the upstream origin.Egress connection
packetsRecvdFromOriginuint64Total packets received by the proxy from the upstream origin.Egress connection

Count fields

All four nodes expose a count field that returns the total number of sampled events (requests, connections, or auth attempts) matching the query filter.

Quantile fields

FieldTypeDescriptionNode
durationMsP50float64Median lifetime of a connection, in milliseconds.Ingress and egress connection
durationMsP95float6495th percentile connection lifetime, in milliseconds.Ingress and egress connection
durationMsP99float6499th percentile connection lifetime, in milliseconds.Ingress and egress connection
handshakeDurationUsP50float64Median TCP+TLS/QUIC handshake time, in microseconds.Ingress and egress connection
handshakeDurationUsP95float6495th percentile handshake time, in microseconds.Ingress and egress connection
handshakeDurationUsP99float6499th percentile handshake time, in microseconds.Ingress and egress connection
connectRequestHandlingDurationUsP50float64Median time to handle a CONNECT request, in microseconds. Not yet available.Request
connectRequestHandlingDurationUsP95float6495th percentile time to handle a CONNECT request, in microseconds. Not yet available.Request
connectRequestHandlingDurationUsP99float6499th percentile time to handle a CONNECT request, in microseconds. Not yet available.Request
connectTunnelSetupDurationUsP50float64Median time to establish a tunnel after receiving a CONNECT request, in microseconds. Not yet available.Request
connectTunnelSetupDurationUsP95float6495th percentile tunnel setup time, in microseconds. Not yet available.Request
connectTunnelSetupDurationUsP99float6499th percentile tunnel setup time, in microseconds. Not yet available.Request

Dimensions

All nodes

FieldTypeDescription
dateDateCalendar date (day granularity).
datetimeMinuteTimeTimestamp truncated to the minute.
datetimeFiveMinutesTimeTimestamp truncated to five-minute intervals.
datetimeFifteenMinutesTimeTimestamp truncated to fifteen-minute intervals.
datetimeHourTimeTimestamp truncated to the hour.
coloCodestringCloudflare data center that handled the request.
endpointstringThe appId that generated traffic.

All timestamp dimensions refer to the end of each connection or request, not the start.

Request node only

FieldTypeDescription
statusCodeuint16HTTP status code returned by the proxy to the client.
proxyStatusstringProxy-level error classification. null when no proxy-level error occurred. Refer to proxy status reference for possible values.
tunnelTypestringTunnel protocol used (connect-tcp, connect-udp, connect-ip). Not yet available.

Ingress connection node only

FieldTypeDescription
transportstringTransport protocol on the client-to-proxy connection (tcp, quic).
tlsVersionstringTLS version negotiated on the client-to-proxy connection. Not yet available.

Egress connection node only

FieldTypeDescription
transportstringTransport protocol on the proxy-to-origin connection (tcp, quic).

Auth node only

FieldTypeDescription
authMethodstringAuthentication method used (for example, Token, Psk).
authResultstringAuthentication outcome (success, failure).

Arguments

All four nodes share the same argument signature.

  • filter required — Filters your data. accountTag is always required inside the filter.
  • limit optional — Maximum number of records to return.
  • orderBy optional — Sort order for results.

Sample queries

privacyProxyRequestMetricsAdaptiveGroups node

Request volume overview

Get a high-level view of daily request volume over a date range.

query DailyRequestVolume(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyRequestMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [date_ASC]
) {
count
dimensions {
date
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Error breakdown by status code and proxy status

Identify which HTTP status codes and proxy-level errors are occurring to pinpoint the source of failures.

query ErrorBreakdown(
$accountTag: String!
$start: Time!
$end: Time!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyRequestMetricsAdaptiveGroups(
filter: {
datetimeFifteenMinutes_geq: $start
datetimeFifteenMinutes_leq: $end
statusCode_geq: 400
}
limit: 10000
orderBy: [datetimeFifteenMinutes_ASC]
) {
count
dimensions {
datetimeFifteenMinutes
statusCode
proxyStatus
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04T00:00:00Z",
"end": "2026-04-06T23:59:59Z"
}

Top proxy errors by frequency

Rank the most frequent proxy error types to prioritize investigation.

query TopProxyErrors(
$accountTag: String!
$start: Date!
$end: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyRequestMetricsAdaptiveGroups(
filter: {
date_geq: $start
date_leq: $end
proxyStatus_neq: ""
}
limit: 10000
orderBy: [count_DESC]
) {
count
dimensions {
proxyStatus
statusCode
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04",
"end": "2026-04-06"
}

Tunnel type distribution

Monitor the mix of connect-tcp, connect-udp, and connect-ip over time to understand how clients are connecting.

query TunnelTypeDistribution(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyRequestMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [date_ASC]
) {
count
dimensions {
date
tunnelType
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

privacyProxyIngressConnMetricsAdaptiveGroups node

Connection volume and ingress bytes overview

Get a high-level view of daily ingress connection count and bytes transferred.

query IngressTrafficOverview(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyIngressConnMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [date_ASC]
) {
count
sum {
bytesSentToClient
bytesRecvdFromClient
}
dimensions {
date
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Connection duration by data center

Compare client-to-proxy connection duration across data centers to identify regions with long-lived or stalled connections.

query IngressDurationByColo(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyIngressConnMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [quantiles_durationMsP50_DESC]
) {
quantiles {
durationMsP50
durationMsP95
durationMsP99
}
dimensions {
coloCode
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Protocol and TLS version distribution

Understanding which transport protocols (QUIC versus TCP) and TLS versions your clients use helps you plan deprecations, detect misconfigured clients, and verify that traffic meets your security requirements.

query IngressProtocolDistribution(
$accountTag: String!
$start: Time!
$end: Time!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyIngressConnMetricsAdaptiveGroups(
filter: {
datetimeFifteenMinutes_geq: $start
datetimeFifteenMinutes_leq: $end
}
limit: 10000
orderBy: [datetimeFifteenMinutes_ASC]
) {
count
dimensions {
datetimeFifteenMinutes
transport
tlsVersion
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04T00:00:00Z",
"end": "2026-04-06T23:59:59Z"
}

privacyProxyEgressConnMetricsAdaptiveGroups node

Egress bytes overview

Get a high-level view of daily bytes flowing between the proxy and the upstream origin.

query EgressBytesOverview(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyEgressConnMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [date_ASC]
) {
count
sum {
bytesSentToOrigin
bytesRecvdFromOrigin
}
dimensions {
date
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Proxy-to-origin latency by data center

Compare proxy-to-origin handshake times across data centers to identify regions with degraded origin reachability.

query EgressLatencyByColo(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyEgressConnMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [quantiles_handshakeDurationUsP50_DESC]
) {
quantiles {
handshakeDurationUsP50
handshakeDurationUsP95
handshakeDurationUsP99
}
dimensions {
coloCode
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Egress performance trend

Track proxy-to-origin handshake latency at fine granularity over a specific time window.

query EgressPerformanceTrend(
$accountTag: String!
$start: Time!
$end: Time!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyEgressConnMetricsAdaptiveGroups(
filter: {
datetimeFiveMinutes_geq: $start
datetimeFiveMinutes_leq: $end
}
limit: 10000
orderBy: [datetimeFiveMinutes_ASC]
) {
quantiles {
handshakeDurationUsP50
handshakeDurationUsP95
handshakeDurationUsP99
}
count
dimensions {
datetimeFiveMinutes
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04T08:00:00Z",
"end": "2026-04-06T14:00:00Z"
}

privacyProxyAuthMetricsAdaptiveGroups node

Auth volume by method

Track daily authentication volume per method to understand adoption and spot anomalies.

query AuthVolumeByMethod(
$accountTag: String!
$startDate: Date!
$endDate: Date!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyAuthMetricsAdaptiveGroups(
filter: {
date_geq: $startDate
date_leq: $endDate
}
limit: 10000
orderBy: [date_ASC]
) {
count
dimensions {
date
authMethod
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"startDate": "2026-04-04",
"endDate": "2026-04-06"
}

Auth failure spike detection

Detect surges in authentication failures and identify which auth method is failing.

query AuthFailureSpike(
$accountTag: String!
$start: Time!
$end: Time!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyAuthMetricsAdaptiveGroups(
filter: {
datetimeMinute_geq: $start
datetimeMinute_leq: $end
authResult: "failure"
}
limit: 10000
orderBy: [datetimeFiveMinutes_ASC]
) {
count
dimensions {
datetimeFiveMinutes
authMethod
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04T10:00:00Z",
"end": "2026-04-06T14:00:00Z"
}

Auth success rate

Compare hourly success versus failure counts to compute auth success rate and spot degradation trends.

query AuthSuccessRate(
$accountTag: String!
$start: Time!
$end: Time!
) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
privacyProxyAuthMetricsAdaptiveGroups(
filter: {
datetimeHour_geq: $start
datetimeHour_leq: $end
}
limit: 10000
orderBy: [datetimeHour_ASC]
) {
count
dimensions {
datetimeHour
authResult
}
}
}
}
}
{
"accountTag": "<YOUR_ACCOUNT_TAG>",
"start": "2026-04-04T00:00:00Z",
"end": "2026-04-06T23:59:59Z"
}