Feb 21, 2024: Announcing Linkerd 2.15 with support for VM workloads, native sidecars, and SPIFFE! Read more »


This is not the latest version of Linkerd!
This documentation is for an older version of Linkerd. In Linkerd 2.15 (current), this document no longer exists.

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

# Get metrics from pod-foo-bar in the default namespace.
linkerd metrics po/pod-foo-bar

# Get metrics from the web deployment in the emojivoto namespace.
linkerd metrics -n emojivoto deploy/web

# Get metrics from the linkerd-controller pod in the linkerd namespace.
linkerd metrics -n linkerd $(
  kubectl --namespace linkerd get pod \
    --selector linkerd.io/control-plane-component=controller \
    --output name
)

Flags

Flag Usage
--namespace
-n
Namespace of resource