diagnostics

Commands used to diagnose Linkerd components.

This command provides subcommands to diagnose the functionality of Linkerd.

Examples

  1. # Get control-plane component metrics
  2. linkerd diagnostics controller-metrics
  3. # Get metrics from the web deployment in the emojivoto namespace.
  4. linkerd diagnostics proxy-metrics -n emojivoto deploy/web
  5. # Get the endpoints for authorities in Linkerd's control-plane itself
  6. linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084

Subcommands

controller-metrics

Fetch metrics directly from Linkerd control plane containers.

This command initiates port-forward to each control plane process, and queries the /metrics endpoint on them.

Flags

FlagUsage
—wait
-w
Time allowed to fetch diagnostics

endpoints

Introspect Linkerd’s service discovery state.

This command provides debug information about the internal state of the control-plane’s destination container. It queries the same Destination service endpoint as the linkerd-proxy’s, and returns the addresses associated with that destination.

Examples

  1. # get all endpoints for the authorities emoji-svc.emojivoto.svc.cluster.local:8080 and web-svc.emojivoto.svc.cluster.local:80
  2. linkerd diagnostics endpoints emoji-svc.emojivoto.svc.cluster.local:8080 web-svc.emojivoto.svc.cluster.local:80
  3. # get that same information in json format
  4. linkerd diagnostics endpoints -o json emoji-svc.emojivoto.svc.cluster.local:8080 web-svc.emojivoto.svc.cluster.local:80
  5. # get the endpoints for authorities in Linkerd's control-plane itself
  6. linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084

Flags

FlagUsage
—destination-podTarget a specific destination Pod when there are multiple running
—output
-o
Output format; one of: “table” or “json”
—tokenThe context token to use when making the request to the destination API

install-sp

proxy-metrics

Fetch metrics directly from Linkerd proxies.

This command initiates a port-forward to a given pod or set of pods, and queries the /metrics endpoint on the Linkerd proxies.

The RESOURCE argument specifies the target resource to query metrics for: (TYPE/NAME)

Examples:

  • cronjob/my-cronjob
  • deploy/my-deploy
  • ds/my-daemonset
  • job/my-job
  • po/mypod1
  • rc/my-replication-controller
  • sts/my-statefulset

Valid resource types include:

  • cronjobs
  • daemonsets
  • deployments
  • jobs
  • pods
  • replicasets
  • replicationcontrollers
  • statefulsets

Examples

  1. # Get metrics from pod-foo-bar in the default namespace.
  2. linkerd diagnostics proxy-metrics po/pod-foo-bar
  3. # Get metrics from the web deployment in the emojivoto namespace.
  4. linkerd diagnostics proxy-metrics -n emojivoto deploy/web
  5. # Get metrics from the linkerd-destination pod in the linkerd namespace.
  6. linkerd diagnostics proxy-metrics -n linkerd $(
  7. kubectl --namespace linkerd get pod \
  8. --selector linkerd.io/control-plane-component=destination \
  9. --output name
  10. )

Flags

FlagUsage
—namespace
-n
Namespace of resource
—obfuscateObfuscate sensitive information