Skip to content

OpenTelemetry

Privacy Proxy exports telemetry data using the OpenTelemetry Protocol (OTLP) ↗. You can configure an endpoint to receive this data and forward it to your observability platform.


Configure telemetry export

During onboarding, provide Cloudflare with your OpenTelemetry collector endpoint:

  • Endpoint URL: The HTTPS endpoint where telemetry data should be sent.
  • Authentication: Headers or credentials required to authenticate with your collector. Supported authentication types include bearer token headers, custom header-based authentication, and mutual TLS (mTLS).

Cloudflare configures your Privacy Proxy instance to export telemetry to this endpoint.


Supported signals

Privacy Proxy exports the following telemetry signals:

SignalDescription
MetricsConnection counts, request rates, latency histograms, error rates
TracesPer-request traces showing proxy processing time. Traces are sampled at approximately 1% of requests.

Metrics

Privacy Proxy exports metrics that help you understand usage patterns and performance.

Connection metrics

MetricDescription
privacy_proxy_connections_totalTotal number of proxy connections
privacy_proxy_connections_activeCurrently active connections
privacy_proxy_connections_duration_secondsConnection duration histogram

Request metrics

MetricDescription
privacy_proxy_requests_totalTotal CONNECT requests processed
privacy_proxy_requests_by_statusRequests grouped by response status code
privacy_proxy_bytes_sent_totalTotal bytes sent to destinations
privacy_proxy_bytes_received_totalTotal bytes received from destinations

Latency metrics

MetricDescription
privacy_proxy_connect_latency_secondsTime to establish connection to destination
privacy_proxy_first_byte_latency_secondsTime to first byte from destination

Server-Timing header

Privacy Proxy includes a Server-Timing header in responses to help measure processing latency from the client side. For full header format details, refer to HTTP headers.

Server-Timing: proxy;dur=12.5

The dur value is the processing time in milliseconds introduced by the proxy. Use this header as a client-side SLI (Service Level Indicator) to monitor proxy performance.

Example: Prometheus and Grafana

To visualize Privacy Proxy metrics in Grafana:

  1. Configure an OpenTelemetry collector to receive data from Privacy Proxy.
  2. Export metrics from the collector to Prometheus.
  3. Create Grafana dashboards using Prometheus as a data source.
Example Prometheus queries
# Request rate over time
rate(privacy_proxy_requests_total[5m])
# 95th percentile connection latency
histogram_quantile(0.95, rate(privacy_proxy_connect_latency_seconds_bucket[5m]))
# Error rate
sum(rate(privacy_proxy_requests_by_status{status=~"5.."}[5m])) / sum(rate(privacy_proxy_requests_total[5m]))