Observability·续

</details>

<details>

<summary>

Prometheus metrics

</summary>

Name Description Type Labels
<code>promhttp_metric_handler_requests_in_flight</code> Current number of scrapes being served. GAUGE
<code>promhttp_metric_handler_requests_total</code> Total number of scrapes by HTTP status code. COUNTER <code>code</code>

</details>

<details>

<summary>

Go runtime metrics

</summary>

Name Description Type Labels
<code>go_gc_duration_seconds</code> A summary of the pause duration of garbage collection cycles. SUMMARY
<code>go_goroutines</code> Number of goroutines that currently exist. GAUGE
<code>go_info</code> Information about the Go environment. GAUGE <code>version</code>
<code>go_memstats_alloc_bytes</code> Number of bytes allocated and still in use. GAUGE
<code>go_memstats_alloc_bytes_total</code> Total number of bytes allocated, even if freed. COUNTER
<code>go_memstats_buck_hash_sys_bytes</code> Number of bytes used by the profiling bucket hash table. GAUGE
<code>go_memstats_frees_total</code> Total number of frees. COUNTER
<code>go_memstats_gc_sys_bytes</code> Number of bytes used for garbage collection system metadata. GAUGE
<code>go_memstats_heap_alloc_bytes</code> Number of heap bytes allocated and still in use. GAUGE
<code>go_memstats_heap_idle_bytes</code> Number of heap bytes waiting to be used. GAUGE
<code>go_memstats_heap_inuse_bytes</code> Number of heap bytes that are in use. GAUGE
<code>go_memstats_heap_objects</code> Number of allocated objects. GAUGE
<code>go_memstats_heap_released_bytes</code> Number of heap bytes released to OS. GAUGE
<code>go_memstats_heap_sys_bytes</code> Number of heap bytes obtained from system. GAUGE
<code>go_memstats_last_gc_time_seconds</code> Number of seconds since 1970 of last garbage collection. GAUGE
<code>go_memstats_lookups_total</code> Total number of pointer lookups. COUNTER
<code>go_memstats_mallocs_total</code> Total number of mallocs. COUNTER
<code>go_memstats_mcache_inuse_bytes</code> Number of bytes in use by mcache structures. GAUGE
<code>go_memstats_mcache_sys_bytes</code> Number of bytes used for mcache structures obtained from system. GAUGE
<code>go_memstats_mspan_inuse_bytes</code> Number of bytes in use by mspan structures. GAUGE
<code>go_memstats_mspan_sys_bytes</code> Number of bytes used for mspan structures obtained from system. GAUGE
<code>go_memstats_next_gc_bytes</code> Number of heap bytes when next garbage collection will take place. GAUGE
<code>go_memstats_other_sys_bytes</code> Number of bytes used for other system allocations. GAUGE
<code>go_memstats_stack_inuse_bytes</code> Number of bytes in use by the stack allocator. GAUGE

</details>

Diagnostic logs

Cloudflare Tunnel generates diagnostic reports that collect data from a single cloudflared instance running on the local machine. This requires cloudflared version 2024.12.2 or later.

Generate diagnostics

  1. (Linux only) To include network diagnostics in the logs, allow the cloudflared user to create RAW and PACKET sockets without root permissions:
   sudo setcap cap_net_raw+ep /usr/bin/traceroute && sudo setcap cap_net_raw+ep /usr/bin/traceroute
   ```

If you do not set `cap_net_raw`, then traceroute data will be unavailable.
2. Get diagnostic logs:

```sh
   cloudflared tunnel diag
   ```

If multiple instances of `cloudflared` are running on the same host, specify the [metrics server IP and port](#configure-a-custom-address) for the instance you want to diagnose. For example:

```sh
   cloudflared tunnel diag --metrics 127.0.0.1:20241
   ```

This command will output the status of each diagnostic task and place a `cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip` file in your working directory.

&lt;details>

&lt;summary>

Docker diagnostics

&lt;/summary>

&lt;code>cloudflared&lt;/code> reads diagnostic data from the &lt;a href="#metrics">tunnel metrics server&lt;/a>. To get diagnostic logs, the metrics server must be exposed from the Docker container and reachable from the host machine.

1. Determine the &lt;a href="#default-metrics-server-address">metrics server port&lt;/a> for the &lt;code>cloudflared&lt;/code> instance running in Docker.
2. Ensure the container is deployed with port forwarding enabled. The diagnostic feature will request information from the Docker instance using local port &lt;code>20241&lt;/code>, therefore you should forward port &lt;code>20241&lt;/code> to the container port obtained in Step 1:

```sh
   docker run -d -p 20241:<metrics_port> docker.io/cloudflare/cloudflared tunnel ...
   ```

3. Verify that you can reach the metrics server address from the Docker host environment:

```sh
   curl localhost:20241/diag/tunnel
   ```

This command should return a JSON:

```json
   {
     "tunnelID": "ef96b330-a7f5-4bce-a00e-827ce5be077f",
     "connectorID": "d236670a-9f74-422f-adf1-030f5c5f0523",
     "connections": [
       { "isConnected": true, "protocol": 1, "edgeAddress": "198.41.192.167"},
       {"isConnected": true, "protocol": 1, "edgeAddress": "198.41.200.113", "index": 1},
       {"isConnected": true, "protocol": 1, "edgeAddress": "198.41.192.47", "index": 2},
       {"isConnected": true, "protocol": 1, "edgeAddress": "198.41.200.73", "index": 3}
     ],
     "icmp_sources": ["192.168.1.243", "fe80::c59:bd4a:e815:ed6"]
   }
   ```

4. Run the diagnostic using the local metrics address and Docker container ID:

```sh
   cloudflared tunnel diag --metrics localhost:20241 --diag-container-id=<containerID>
   ```

Alternatively, you can specify the container's name instead of its ID:

```sh
   cloudflared tunnel diag --metrics localhost:20241 --diag-container-id=<containerName>
   ```

If you forwarded a different local port in Step 2, replace &lt;code>20241&lt;/code> with that port.

Running the diagnostic command with the container ID allows &lt;code>cloudflared&lt;/code> to collect information from the Docker environment such as logs and container details.

This command will output the status of each diagnostic task and place a &lt;code>cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip&lt;/code> file in your working directory.

&lt;/details>

&lt;details>

&lt;summary>

Kubernetes diagnostics

&lt;/summary>

The diagnostic feature will request data from the &lt;a href="#metrics">tunnel metrics server&lt;/a> using ports &lt;code>20241&lt;/code> to &lt;code>20245&lt;/code>. You will need to use port forwarding to allow the local &lt;code>cloudflared&lt;/code> instance to connect to the metrics server on one of these ports.

1. Determine the tunnel's &lt;a href="#default-metrics-server-address">metrics server port&lt;/a>.
2. Enable port forwarding:

```sh
   kubectl port-forward <pod> <diagnostic_port>:<metrics_port>
   ```

- &lt;code>&lt;pod&gt;&lt;/code>: Name of the pod where the tunnel is running
   - &lt;code>&lt;diagnostic_port&gt;&lt;/code> is any local port in the range &lt;code>20241&lt;/code> to &lt;code>20245&lt;/code>.
   - &lt;code>&lt;metrics_port&gt;&lt;/code> is the Kubernetes pod port for the &lt;code>cloudflared&lt;/code> instance you want to diagnose (obtained in Step 1).

For example, if you set the metrics server address to &lt;code>0.0.0.0:12345&lt;/code>:

```sh
   kubectl port-forward cloudflared-6d4897585b-r8kfz 20244:12345
   ```

Connections made to local port &lt;code>20244&lt;/code> are forwarded to port &lt;code>12345&lt;/code> of the pod that is running the tunnel.
3. Run the diagnostic:

```sh
   cloudflared tunnel diag --diag-pod-id=<podID>
   ```

If the pod has multiple applications/services running and &lt;code>cloudflared&lt;/code> is not the first in the pod, you must specify either the container ID or name:

```sh
   cloudflared tunnel diag --diag-pod-id=<podID> --diag-container-id=<containerName>
   ```

This command will output the status of each diagnostic task and place a &lt;code>cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip&lt;/code> file in your working directory.

&lt;/details>

### Diagnostic file contents

The `cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip` archive contains the files listed below. The data in a file either applies to the `cloudflared` instance being diagnosed (`diagnosee`) or the instance that triggered the diagnosis (`diagnoser`). For example, if your tunnel is running in a Docker container, the diagnosee is the Docker instance and the diagnoser is the host instance.

| File name | Description | Instance |
| --- | --- | --- |
| `cli-configuration.json` | [Tunnel run parameters](https://developers.cloudflare.com/tunnel/reference/run-parameters/) used when starting the tunnel | diagnosee |
| `cloudflared_logs.txt` | [Tunnel log file](#logs)&lt;sup>[1](#user-content-fn-1)&lt;/sup> | diagnosee |
| `configuration.json` | Tunnel configuration parameters | diagnosee |
| `goroutine.pprof` | goroutine profile made available by `pprof` | diagnosee |
| `heap.pprof` | heap profile made available by `pprof` | diagnosee |
| `metrics.txt` | Snapshot of [Tunnel metrics](#metrics) at the time of diagnosis | diagnosee |
| `network.txt` | JSON traceroutes to Cloudflare's global network using IPv4 and IPv6 | diagnoser |
| `raw-network.txt` | Raw traceroutes to Cloudflare's global network using IPv4 and IPv6 | diagnoser |
| `systeminformation.json` | Operating system information and resource usage | diagnosee |
| `task-result.json` | Result of each diagnostic task | diagnoser |
| `tunnelstate.json` | Tunnel connections at the time of diagnosis | diagnosee |

## Footnotes

1. If the log file is blank, you may need to [set `--loglevel` to `debug`](#server-side-logs) when you start the tunnel. The `--loglevel` parameter is only required if you ran the tunnel from the CLI using a `cloudflared tunnel run` command. It is not necessary if the tunnel runs as a Linux/macOS service or runs in Docker/Kubernetes. [↩](#user-content-fnref-1)

Was this helpful?

YesNo

## On this page

[![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NiIgaGVpZ2h0PSIzMCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDY2IDMwIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNzQ2XzIpIj48cGF0aCBmaWxsPSIjZmY5OTEwIiBkPSJNNTMuMTIgMTMuMTI1YzYuOTk3IDAgMTIuNjY4IDUuNzA4IDEyLjY2OCAxMi43NSAwIDEuMjU1LS4xOCAyLjQ2OC0uNTE2IDMuNjE0YS43Mi43MiAwIDAgMS0uNjk0LjUxMUg0Ni45NTNhLjM3NS4zNzUgMCAwIDEtLjM0OC0uNTFsLjMzNy0uODgyYzEuMDc2LTIuODMzIDQuMTQ2LTUuMTU0IDYuOTg3LTUuMjlsNS4zODQtLjI3N2EuNTQzLjU0MyAwIDAgMCAuNTE0LS41NDQuNTQzLjU0MyAwIDAgMC0uNTEtLjU0NGwtNS4wNTYtLjI5OWMtMi43MTgtLjE0LTQuMDQ2LTIuNTYtMy4zMTUtNS4wODFsLjg0Mi0yLjkwMmEuNzIuNzIgMCAwIDEgLjY0Ni0uNTI3cS4zNC0uMDIuNjg2LS4wMTkiLz48cGF0aCBmaWxsPSIjZmY1ZjA4IiBkPSJNMzUuNjA5IDBjNy4yOTUgMCAxMy40MjQgNS4wMjUgMTUuMTU3IDExLjgyNC4wNzMuMjg1LjA1LjU4Ni0uMDU0Ljg2MmwtMS4zODggMy42NzdjLTEuMDc2IDIuODMzLTMuODQyIDUuMjktNi45NyA1LjI5bC0yNC4xMDUuMjc4YS41MzMuNTMzIDAgMCAwLS41MjUuNTM1YzAgLjI5My4yMzQuNTMxLjUyNC41MzVsMjMuNzY1LjMxNmMyLjcyNCAwIDQuMDQ2IDI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jIzNC41MzEuNTI0LjUzNWwyMy43NjUuMzE2YzIuNzI0IDAgNC4wNDYgMi41NiAzLjMxNiA1LjA4MWwtLjMwNyAxLjA2MWEuNzUuNzUgMCAwIDEtLjcxNi41NDFILjk2NGEuNzEuNzEgMCAwIDEtLjcxOC0uNjQ2IDExIDExIDAgMCAxLS4wMzQtLjg1NGMwLTUuNDc2IDQuMTY2LTkuOTczIDkuNDgyLTEwLjQ1NmE3LjIgNy4yIDAgMCAxLS4xNjctMS41NDRjMC0zLjkzNSAzLjE3LTcuMTI1IDcuMDgtNy4xMjUgMS41NTUgMCAyLjk5NC41MDYgNC4xNjIgMS4zNjJDMjIuODQ5IDQuNDk3IDI4LjcwNyAwIDM1LjYwOSAwIi8+PC9nPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDBfNzQ2XzIiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoNjZ2MzBIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/tunnel/observability/#page","headline":"Observability","description":"Monitor tunnel health, connectors, and connection status.","url":"https://developers.cloudflare.com/tunnel/observability/","inLanguage":"en","image":"https://developers.cloudflare.com/tunnel/observability/og.png?v=b6362e17db073593","dateModified":"2026-10-02","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Logging"]}


description: Review recent changes to Cloudflare Tunnel. title: Changelog image: https://developers.cloudflare.com/tunnel/platform/changelog/og.png?v=124e22b5c2293a4a


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/tunnel/llms.txt
Use this file to discover all available pages before exploring further.