- Regional analysts
- Assigned to Okta group
regional_analysts_us
orregional_analysts_ca
. - View alerts for their region.
- Manage anomalies and investigations for their region.
- Assigned to Okta group
- Global Viewers
- Assigned to Okta group
global_viewers
. - View alerts, anomalies, and investigations for any region.
- Assigned to Okta group
- Admins/makers:
- Assigned to Okta group
thirdeye_admin
. - Create alerts for any region.
- Manage authorization policies.
- Assigned to Okta group
Recipe outline
- Handle prerequisites and setup
- Create the namespaces we’ll use to group our ThirdEye resources
- Restrict access to ThirdEye resources with access control policies
- Create an alert with separate timeseries for US and Canada data using dimension exploration
Prerequisites
- Obtain your StarTree cloud bearer token.
- Log into the Authorization server’s UI. If your ThirdEye is at https://thirdeye.my-env.my-org.startree.cloud, then the authorization server ui is at https://my-env.my-org.startree.cloud/auth/swagger-ui/index.html.
Namespaces
First, we’ll create a set of namespaces to group our ThirdEye alerts, anomalies and other resources. The access control policies will apply to these namespaces instead of individual resources. Namespaces are string values that must match regex^[a-z0-9-_]+$
.
We set the namespace of alerts and its enumeration items in the alert configuration. Anomalies and investigations are automatically assigned to the namespace of the alert or enumeration item it is assigned to. Resources that do not have a configured namespace are placed in the default
namespace.
In this recipe, we’ll create 3 namespaces:
thirdeye_dx_alerts
- This will contain the dimension exploration alerts.regional_analysts_us
- This will contain the US dimension and all related investigations and anomalies.regional_analysts_ca
- This will contain the CA dimension and all related investigations and anomalies.
default
namespace.


Create the namespaces
Here are the JSON payloads needed to create the namespaces. To enable each, copy and paste the code directly into the Swagger UI’screate namespace
tool.
If you get a 403 Forbidden error, this means you do not have permission to create namespaces. Reach out to ThirdEye support for help.
thirdeye_dx_alerts
regional_analysts_us
regional_analysts_ca
Policies
Next, let’s create the policies. Like ThirdEye resources, policies are assigned to a namespace. A policy will only apply to resources in its namespace, except for one special case: Policies in the default namespace are applied to all resources.Create the policies
To enable each, copy and paste the code directly into the Swagger UI’screate policy
tool.
Grant read and write access to the admin group
This policy allows users in the thirdeye_admin Okta group to read and write all entities. We assign the policy to the default namespace, so all entities are covered.Grant read access to global viewers
This policy allows users in the global_viewers Okta group to read all entities. Same as before, this policy goes in the default namespace to cover all entities.Grant read access for all alert templates
This policy allows all users to read the alert templates. Since alert templates are used to render alerts, but cannot be used to view data by themselves, we can use a lenient read policy. This policy will cover the standard ThirdEye alert templates, which are in the default namespace.Grant read access for the dimension exploration alerts
This policy allows all users to read the ThirdEye alerts in thethirdeye_dx_alerts
namespace. When we create an alert, we must also assign it to the thirdeye_dx_alerts
namespace so all users can see it.
Grant read+write access to anomalies and investigations in the regional namespaces.
Finally, let’s create policies to allow our regional analysts to read and write anomalies and investigations in their namespaces.(Optional) Grant read access to all entities in the regional namespaces
We may want to create alerts without dimension exploration, but still have the anomalies and investigations stay in a regional namespace. For this use-case, we create the alert in the regional namespace instead of thethirdeye-dx-alerts
namespace. We’ll then add a policy to allow our regional analysts read access to all entities in their namespace.
Create the Alert and Enumeration Items
Finally, it’s time to create the alert. This alert uses thestartree-threshold-dx
template and the pageviews
demo dataset. The alert has two enumeration items: one for data from the US and one for data from Canada. The alert itself is created in the thirdeye_dx_alerts
namespace that anyone can read, and the enumeration items are created in their region-specific namespace.
Check that the dataSource
and dataset
template properties match the names for your instances.
Paste this alert body in ThirdEye’s Create Alert
JSON editor:
Results
With the access control policies in place, the alert will look different for the different user groups.ThirdEye admins and global viewers
This is how the alert will look for the thirdeye admins and global viewers. We can see the timeseries and anomalies for both US and Canada.
Regional analysts for US
This is how the alert will look for the US analysts. Only the timeseries and anomalies for the US are visible.
Regional analysts for Canada
This is how the alert will look for the Canada analysts. Only the timeseries and anomalies for Canada are visible.