Create and use filter templates

Filter templates allow you to create advanced queries against your telemetry provider.

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

  1. In the canary configuration , find the Filter Templates section, and click Add Template.

  2. Provide a name.

    This name is then populated in the Configure Metric dialog for each individual metric in this config.

    Simple query template

  3. In the Template field, enter the filter.

    Simple query template

Apply filter templates to metrics

  1. For any metric in this configuration, click the edit icon.

  2. 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

  1. In the canary stage config , under Extended Params, click Add Field.

    This will create a value for one parameter.

  2. Under Key, type a variable you used in a filter template in the config this stage is using.

  3. Add the value you want for that variable. You can use any literal or pipeline expression .