You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TUN-8724: Add CLI command for diagnostic procedure
## Summary
Adds a new CLI subcommand, under the tunnel command, the `diag`. This command has as function the automatic collection of different data points, such as, logs, metrics, network information, system information, tunnel state, and runtime information which will be written to a single zip file.
Closes TUN-8724
Usage: "Source address and the interface name to send/receive ICMPv6 messages. If not provided cloudflared will dial a local address to determine the source IP or fallback to ::.",
180
190
EnvVars: []string{"TUNNEL_ICMPV6_SRC"},
181
191
}
192
+
metricsFlag=&cli.StringFlag{
193
+
Name: metricsFlagName,
194
+
Usage: "The metrics server address i.e.: 127.0.0.1:12345. If your instance is running in a Docker/Kubernetes environment you need to setup port forwarding for your application.",
195
+
Value: "",
196
+
}
197
+
diagContainerFlag=&cli.StringFlag{
198
+
Name: diagContainerIDFlagName,
199
+
Usage: "Container ID or Name to collect logs from",
200
+
Value: "",
201
+
}
202
+
diagPodFlag=&cli.StringFlag{
203
+
Name: diagPodFlagName,
204
+
Usage: "Kubernetes POD to collect logs from",
205
+
Value: "",
206
+
}
207
+
noDiagLogsFlag=&cli.BoolFlag{
208
+
Name: noDiagLogsFlagName,
209
+
Usage: "Log collection will not be performed",
210
+
Value: false,
211
+
}
212
+
noDiagMetricsFlag=&cli.BoolFlag{
213
+
Name: noDiagMetricsFlagName,
214
+
Usage: "Metric collection will not be performed",
215
+
Value: false,
216
+
}
217
+
noDiagSystemFlag=&cli.BoolFlag{
218
+
Name: noDiagSystemFlagName,
219
+
Usage: "System information collection will not be performed",
220
+
Value: false,
221
+
}
222
+
noDiagRuntimeFlag=&cli.BoolFlag{
223
+
Name: noDiagRuntimeFlagName,
224
+
Usage: "Runtime information collection will not be performed",
Description: "cloudflared tunnel diag will create a diagnostic report of a local cloudflared instance. The diagnostic procedure collects: logs, metrics, system information, traceroute to Cloudflare Edge, and runtime information. Since there may be multiple instances of cloudflared running the --metrics option may be provided to target a specific instance.",
log.Info().Msg("Couldn't extract logs from the instance. If the instance is running in a containerized environment use the option --diag-container-id or --diag-pod-id. If there is no logging configuration use --no-diag-logs.")
1105
+
}
1106
+
1107
+
iferr!=nil {
1108
+
log.Warn().Msg("Diagnostic completed with one or more errors")
0 commit comments