Create and use filter templates
Filter templates allow you to compose and parameterize advanced queries against your telemetry provider. Parameterized queries are hydrated by values provided in the canary stage .
Things to keep in mind
Each filter template you create for a given canary configuration is available to each individual metric you add.
The query against your metrics is the metric type plus selectors that refine what is returned in the time series.
For Spinnaker canary purposes, the filter template contains only those refining selectors. The metric type is provided by the list of metrics above.
The purpose of the metric filter is to allow you to parameterize what is in these refining selectors, but it is perfectly legal to use literal values in filter templates.
Create a filter template
In the canary configuration , find the Filter Templates section, and click Add Template.
Provide a name.
This name is then populated in the Configure Metric dialog for each individual metric in this config.
In the Template field, enter the filter.
Apply filter templates to metrics
For any metric in this configuration, click the edit icon.
Click the Filter Template field, and select the template you want to apply to time series using this metric.
Provide runtime values for parameterized filters
In the canary stage config , under Extended Params, click Add Field.
This will create a value for one parameter.
Under Key, type a variable you used in a filter template in the config this stage is using.
Add the value you want for that variable. You can use any literal or pipeline expression .