# Access Policies

> Leverage Last9's access policies to perform traffic shaping of time series data in real-time.

Source: https://last9.io/docs/access-policies/

Last9 supports automatic data tiering of the metrics based on retention
policies. These data tiers have different retention policies. E.g., Blaze Tier
stores data for the last two hours, whereas Hot Tier stores data for the last
six months. Depending on the use case, the tiers are designed to access their
metrics from a fast or slow tier.

It is extremely crucial to ensure that traffic for real-time alerting is always
prioritized and served from the fastest Blaze tier. The Grafana queries can be
served from the Hot tier without conflicting with alerting. Access Policies
ensure that one can create these policy guardrails to ensure the metrics data is
accessible from a specific tier based on its purpose.

:::note

Access Policies are specific to a Last9 cluster. Different clusters can have
different Access Policies.

:::

Each Access Policy is associated with a Token created for a Tier. Tokens allow
ACL for time series data by providing a way to access data from specific tiers
for either `read` `write` or both operations.

## Setting up Tokens

To achieve this, create a read token first from Settings -> Tokens.

<iframe width="100%" height="400px" src="https://www.youtube.com/embed/qfdUYwAMZvw" title="Creating a Read Token in Levitate" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Creating Access Policy

Once the Token is created, one can create an Access Policies from Settings ->
Policies.

<iframe width="100%" height="400px" src="https://www.youtube.com/embed/0j_N9CKyigY" title="Creating Access Policy in Levitate" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

That's it, you don't have to change anything more. Just use the token associated
with the Alerting policy to configure alertmanager and the token associated with
the visualization policy to [configure Grafana](/docs/grafana-config/).

Last9 will take care of performing traffic shaping in real-time.

---

## Troubleshooting

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
