Dynamic labels

The legend of a search expression often contains long, hard to read names. Dynamic labels build the label of every series from its properties, and update automatically.

  1. Choose Clear graph. On Browse, choose CWAgent, then ImageId, InstanceId, InstanceType, exe, process_name (1). These are the per-process (procstat) metrics of the CloudWatch agent process.

procstat dimensions

  1. Search for memory_rss (1) and choose Graph search (2). Three rows match, one per instance (3).

procstat_memory_rss

  1. On Graphed metrics, choose Add dynamic label, Properties (1), then Dim.DimName - dimension value (2).

Add dynamic label

  1. The label becomes [dimension: ${PROP('Dim.DimName')}] (1). DimName is only a placeholder, so the legend shows -- (2).

Placeholder label

  1. Choose the pencil icon in the Label column, replace the label with the line below (1) and choose Apply (2).

    ${PROP('Dim.process_name')} - ${PROP('Dim.InstanceId')} - ${PROP('MetricName')}
    

Edit the label

  1. Every series now has a clear label: process name, instance and metric name (1).

Dynamic labels