How to Use Point Tags for Maintenance Windows


This article applies to:


Product edition: All

Feature Category: Maintenance Windows




Maintenance Windows are a useful way to ensure that alerts do not fire during known events or known periods of maintenance. Currently, the way to configure what alerts a Maintenance Window should affect is the combination of Alert Tag(s) and Source Tags and/or Source Names. Often, however, it is helpful to use data within point tags to determine what time series should be affected by a Maintenance Window. This article covers an approach that will allow accounting for point tags in Maintenance Windows.  



Strategy for Using Points Tags in Maintenance Windows:


The general idea of this strategy is to elevate point tags to the source name. The aliasSource function is key to this strategy.


To illustrate this strategy, let's take an example data point:

metric name: 
source name: app-name
point tags: env=prod, az=east, cluster=1a, shard=shard-a


Suppose we wanted to create Maintenance Windows based on the environment of the app. Let's take a look at the steps needed to accomplish this.



Step 1: Elevate the Point Tag Value to the Source Name


Since the env point tag contains the environment information, we would need to somehow access the value of that point tag when configuring our Maintenance Window. Suppose we still wanted to keep the current source name intact. One approach we could take is to use this query in our alert condition:


aliasSource(ts(, {{source}}/{{env}})


As described in the documentation for the aliasSource function, it is possible to use variables to obtain the value of various components of a data point, including that of a specific point tag. So, the resulting data of the above query would be:

metric name: 
source name: app-name/prod
point tags: env=prod, az=east, cluster=1a, shard=shard-a


Notice that we now have the value of the env point tag within the source name. The original source name and the environment are separated by a slash. We could have used any format so this is purely for demonstration purposes. Adjust accordingly for your own use case.



Step 2: Set-Up a Maintenance Window Accounting for the New Source Name 


Now that the source name includes the environment information, we can take advantage of this when setting up our Maintenance Window. Simply set the appropriate source name in the Affected Sources field of the Maintenance Window. Taking our example, we would have something that looks like this:




Now, this Maintenance Window will affect alerts that have time series from the prod environment.


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk