Observability
Last updated Oct 2, 2026 Cloudflare Tunnel exposes logs, metrics, and diagnostic tools to help you monitor tunnel health and resolve issues.
Tunnel health
You can check your tunnel connection status in the Cloudflare dashboard ↗︎ by going to Networking > Tunnels, or by running cloudflared tunnel list.
| Status | Meaning | Recommended Action |
|---|---|---|
| Healthy | The tunnel is active and serving traffic through four connections to the Cloudflare global network. | No action is required. Your tunnel is running correctly. |
| Inactive | The tunnel has been created (via the API or dashboard) but the cloudflared connector has never been run to establish a connection. |
Install and run cloudflared on your origin server to connect the tunnel to Cloudflare. You can find the installation command in the Cloudflare dashboard under Networking > Tunnels — select your tunnel, then on the Overview tab select Add a replica. For API-based setup, refer to Install and run the tunnel. |
| Down | The tunnel was previously connected but is currently disconnected because the cloudflared process has stopped. |
1. Ensure the cloudflared service or process is actively running on your server. <br> 2. Check for server-side issues, such as the machine being powered off, an application crash, or recent network changes. |
| Degraded | The cloudflared connector is running and the tunnel is serving traffic, but at least one individual connection has failed. Further degradation in tunnel availability could risk the tunnel going down and failing to serve traffic. |
1. Review your cloudflared logs for connection failures or error messages. <br> 2. Investigate local network and firewall rules to ensure they are not blocking connections to the Cloudflare Tunnel IPs and ports. <br> |
Tunnel status scope
The tunnel status only reflects the connection between cloudflared and the Cloudflare network. It does not indicate whether cloudflared can reach your internal services. A tunnel can appear Healthy while users are unable to connect to an application.
Notifications
Administrators can receive alerts when tunnels change health or deployment status. Notifications can be delivered by email, webhook, or third-party services.
To configure tunnel notifications, refer to Create a notification.
<details>
<summary>
Tunnel Creation or Deletion Event
</summary>
Who is it for?
Customers who want to receive a notification when Cloudflare Tunnels are created or deleted in their account.
Other options / filters
None.
Included with
All Cloudflare Zero Trust plans.
What should you do if you receive one?
No action is needed.
</details>
<details>
<summary>
Tunnel Health Alert
</summary>
Who is it for?
Customers who want to be warned about changes in health status for their Cloudflare Tunnels.
Other options / filters
None.
Included with
All Cloudflare Zero Trust plans.
What should you do if you receive one?
Monitor tunnel health over time and consider deploying <a href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/tunnel-availability/"><code>cloudflared</code> replicas or load balancers</a>.
Additional information
Refer to <a href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/troubleshoot-tunnels/common-errors/#tunnel-status">Tunnel status</a> to review the list of possible tunnel statuses (<code>Healthy</code>, <code>Inactive</code>, <code>Down</code> and <code>Degraded</code>).
</details>
Logs
Tunnel logs record all activity between cloudflared and the Cloudflare global network, and all activity between cloudflared and your origin server.
Server-side logs
If you have access to the origin server, you can use the --loglevel flag to enable logging when you start the tunnel. By default, cloudflared writes logs to standard error (stderr) and does not store logs on the server.
Note
Requires cloudflared version 2025.6.1 or later.
To format each log line as a JSON object, add --output json before run:
cloudflared tunnel --output json run <UUID>
This format is useful for Kubernetes deployments and log collection systems that consume JSON.
For routine persistent logging, run the tunnel with --log-directory <PATH>. This flag writes logs to cloudflared.log in the specified directory, rotates the file when it reaches 1 MB, and keeps up to five backups. It does not remove logs based on age.
cloudflared tunnel --loglevel info --log-directory <PATH> run <UUID>
Use the --logfile flag instead for short troubleshooting sessions or when another tool manages rotation. cloudflared does not rotate the file specified by --logfile. If you set both flags, --logfile takes precedence.
Remote log streaming
You can stream real-time logs from a running tunnel without SSH access to the server.
The cloudflared daemon can stream logs from any tunnel in your account to the local command line. cloudflared must be installed on both your local machine and the origin server.
- On your local machine, authenticate
cloudflaredto your Cloudflare account:
cloudflared tunnel login
```
2. Run `cloudflared tail` for a specific tunnel:
```sh
cloudflared tail <UUID>
```
For a more structured view of the JSON message, you can pipe the output to tools like [jq ↗︎](https://stedolan.github.io/jq/):
```sh
cloudflared tail --output=json <UUID> | jq .
```
3. If you are running multiple [replicas](https://developers.cloudflare.com/tunnel/configuration/#replicas-and-high-availability), you can specify which replica to stream logs from:
```sh
cloudflared tail --connector-id <REPLICA ID> <UUID>
```
To find the replica ID, go to **Networking** > **Tunnels** and select your tunnel. All active replicas appear in the **Connectors** list on the tunnel overview page. The replica ID is the **Connector ID**.
<details>
<summary>
Log filtering options
</summary>
You can filter logs by event type (<code>--event</code>), event level (<code>--level</code>), or sampling rate (<code>-sampling</code>) to reduce the volume of logs streamed from the origin. This helps mitigate the performance impact on the origin, especially when the origin is normally under high load. For example:
```sh
cloudflared tail --level debug <UUID>
| Flag | Description | Allowed values | Default value |
|---|---|---|---|
| <code>--event</code> | Filter by the type of event / request. | <code>cloudflared</code>, <code>http</code>, <code>tcp</code>, <code>udp</code> | All events |
| <code>--level</code> | Return logs at this level and above. Works independently of the <a href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/run-parameters/#loglevel"><code>--loglevel</code></a> setting on the server. | <code>debug</code>, <code>info</code>, <code>warn</code>, <code>error</code>, <code>fatal</code> | <code>debug</code> |
| <code>--sampling</code> | Sample a fraction of the total logs. | Number from <code>0.0</code> to <code>1.0</code> | <code>1.0</code> |
</details>
To stream tunnel logs from the dashboard:
- In the Cloudflare dashboard, go to Networking > Tunnels and select your tunnel. Go to Tunnels ↗
- Go to the Live logs tab.
- Select Live to start streaming.
View logs for a replica
If you are running multiple cloudflared instances for the same tunnel (also known as replicas), logs from all connected replicas are streamed automatically and grouped by hostname, making it easy to identify which host machine produced each log entry.
To filter the stream to specific replicas, select the Filter icon and expand the Replicas section. You can also filter by Log Level and Event Type.
Network session logs
Zero Trust Network Session Logs record each private network session that Cloudflare routes to a tunnel. Sessions routed to a Cloudflare Tunnel report Offramp as TUNNEL. Two fields show exactly where a session was sent:
| Field | Description |
|---|---|
DestinationTunnelID |
The tunnel that received the session. |
DestinationReplicaID |
The cloudflared replica that received the session. This value matches the replica's Connector ID in the dashboard. |
If you run multiple replicas, use these fields to confirm which tunnel and which replica received traffic for a specific session. To investigate that replica further, stream its logs with cloudflared tail --connector-id <DESTINATION_REPLICA_ID> <TUNNEL_ID>.
Network Session Logs are available through Logpush.
Metrics
Tunnel metrics show a Cloudflare Tunnel's throughput and resource usage over time. When you run a tunnel, cloudflared will spin up a Prometheus metrics endpoint — an HTTP server that exposes metrics in Prometheus ↗︎ format. You can use the Prometheus toolkit on a remote machine to scrape metrics data from the cloudflared server.
Default metrics server address
In non-containerized environments, cloudflared starts the metrics server on 127.0.0.1:<PORT>/metrics, where <PORT> is the first available port in the range 20241 to 20245. If all ports are unavailable, cloudflared binds to a random port. In containerized environments (Docker, Kubernetes), the default address is 0.0.0.0:<PORT>/metrics.
To determine the default port, check your tunnel logs around the time when the tunnel started. For example:
2024-12-19T21:17:58Z INF Starting metrics server on 127.0.0.1:20241/metrics
Configure a custom address
To serve metrics on a custom IP address and port, perform these steps on the cloudflared host:
- Run the tunnel using the
--metricsflag. For example,
sh
cloudflared tunnel --metrics 127.0.0.1:60123 run my-tunnel
Note
If you plan to fetch metrics from another machine on the local network, replace 127.0.0.1 with the internal IP of the cloudflared server (for example, 198.168.x.x). To serve metrics on all available network interfaces, use 0.0.0.0.
2. Verify that the metrics server is running by going to http://localhost:60123/metrics. This will only work if you configured a localhost IP ( 127.0.0.1 or 0.0.0.0).
You can now export the metrics to Prometheus and Grafana to visualize and query the data. Refer to the Grafana tutorial for instructions on getting started with these tools.
<details>
<summary>
cloudflared metrics
</summary>
| Name | Description | Type | Labels |
|---|---|---|---|
| <code>build_info</code> | Build and version information. | GAUGE | <code>goversion</code>, <code>revision</code>, <code>type</code>, <code>version</code> |
| <code>cloudflared_config_local_config_pushes</code> | Number of local configuration pushes to Cloudflare. | COUNTER | |
| <code>cloudflared_config_local_config_pushes_errors</code> | Number of errors that occurred during local configuration pushes. | COUNTER | |
| <code>cloudflared_orchestration_config_version</code> | Configuration version. | GAUGE | |
| <code>cloudflared_tcp_active_sessions</code> | Concurrent number of TCP sessions that are being proxied to any origin. | GAUGE | |
| <code>cloudflared_tcp_total_sessions</code> | Total number of TCP sessions that have been proxied to any origin. | COUNTER | |
| <code>cloudflared_tunnel_active_streams</code> | Total number of active streams. | GAUGE | |
| <code>cloudflared_tunnel_concurrent_requests_per_tunnel</code> | Concurrent number of requests proxied through each tunnel. | GAUGE | |
| <code>cloudflared_tunnel_ha_connections</code> | Number of active HA connections. | GAUGE | |
| <code>cloudflared_tunnel_request_errors</code> | Number of errors proxying to origin. | COUNTER | |
| <code>cloudflared_tunnel_server_locations</code> | Where each tunnel is connected to. <code>1</code> means current location, <code>0</code> means previous locations. | GAUGE | <code>connection_id</code>, <code>edge_location</code> |
| <code>cloudflared_tunnel_timer_retries</code> | Unacknowledged heart beats count. | GAUGE | |
| <code>cloudflared_tunnel_total_requests</code> | Number of requests proxied through all tunnels. | COUNTER | |
| <code>cloudflared_tunnel_tunnel_authenticate_success</code> | Number of successful tunnel authentication events. | COUNTER | |
| <code>cloudflared_tunnel_tunnel_register_success</code> | Number of successful tunnel registrations. | COUNTER | <code>rpcName</code> |
| <code>cloudflared_udp_active_sessions</code> | Concurrent number of UDP sessions that are being proxied to any origin. | GAUGE | |
| <code>cloudflared_udp_total_sessions</code> | Total number of UDP sessions that have been proxied to any origin. | COUNTER | |
| <code>coredns_panics_total</code> | Number of panics. | COUNTER | |
| <code>quic_client_closed_connections</code> | Number of connections that have been closed. | COUNTER | |
| <code>quic_client_latest_rtt</code> | Latest round-trip time (RTT) measured on a connection. | GAUGE | <code>conn_index</code> |
| <code>quic_client_lost_packets</code> | Number of packets that have been lost from a connection. | COUNTER | <code>conn_index</code>, <code>reason</code> |
| <code>quic_client_min_rtt</code> | Lowest RTT measured on a connection in ms. | GAUGE | <code>conn_index</code> |
| <code>quic_client_packet_too_big_dropped</code> | Number of packets received from origin that are too big to send to Cloudflare and are dropped as a result. | COUNTER | |
| <code>quic_client_smoothed_rtt</code> | Smoothed RTT calculated for a connection in ms. | GAUGE | <code>conn_index</code> |
| <code>quic_client_total_connections</code> | Number of connections initiated. For all QUIC metrics, client means the side initiating the connection. | COUNTER |
