# Query

> Control Plane tools for query-level configurations.

Source: https://last9.io/docs/control-plane-query/

## Macros

![Control Plane — Macros](../../../../../assets/content/docs/control-plane/query/control-plane-macros.png)

They work in a way that is similar to how SQL developers use stored procedures. Macros take full advantage of the time-tested best practices of functions, abstractions, and reusability to replace cumbersome and error-prone methods.

Simplify your PromQLs that are reused often to avoid repition of code, and improve abstractions and readability. [Read more](/docs/promql-macros/) on how to configure these macros.

## Scrape Interval

Set this to the typical scrape and evaluation interval configured in your agent’s config file. If you set this to a greater value than your agent’s config file interval, the embedded Grafana in Explore will evaluate the data according to this interval and you will see less data points.

Notes:

- Defaults to 1m.
- This does not change your agent’s scrape interval.

## Read Data

![Control Plane — Read Data](../../../../../assets/content/docs/control-plane/query/control-plane-read-data.png)

If you're looking to use your stored telemetry data outside of Last9's [Alerting](https://app.last9.io/alert-studio) or [Managed Grafana](https://app.last9.io/explore), you can refer to the Read Data settings to configure your choice of visualization tool.

For additional settings on how to configure your own Grafana to use Last9 as a datasource, [read this](/docs/grafana-config/).

## Scheduled Search

![Control Plane — Scheduled Search](../../../../../assets/content/docs/control-plane/query/control-plane-scheduled-search.png)

Create periodic searches on telemetry data and set alerts when patterns are found or missing. [Read more](/docs/scheduled-search/) on how configure these alerts.

Supported telemetry types: Logs, and Traces coming soon.

## Query Tokens

![Control Plane — Query Tokens](../../../../../assets/content/docs/control-plane/query/query-tokens/control-plane-query-tokens.png)

Query Tokens provide read-only access to your telemetry data for external visualization tools like Grafana, alerting systems, and custom applications.

A system-generated query token is created when you signup — this token is used to set up dashboard templates, including the Health Dashboard. System-generated tokens cannot be deleted.

---

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