> ## Documentation Index
> Fetch the complete documentation index at: https://axiom.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://axiom.co/docs/feedback

```json
{
  "path": "/apps/grafana",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Connect Axiom with Grafana

> Learn how to extend the functionality of Grafana by installing the Axiom data source plugin.

<Frame caption="Data visualisation">
  <img src="https://mintcdn.com/axiom/ht_bivVnbPw26JRw/doc-assets/shots/grafana-axiom-image-3.jpg?fit=max&auto=format&n=ht_bivVnbPw26JRw&q=85&s=1772cc2b83eb47c34d2d5454d3c51ed9" alt="Data visualisation" width="1404" height="1016" data-path="doc-assets/shots/grafana-axiom-image-3.jpg" />
</Frame>

## What’s a Grafana data source plugin?

Grafana is an open-source tool for time-series analytics, visualization, and alerting. It’s frequently used in DevOps and IT Operations roles to provide real-time information on system health and performance.

Data sources in Grafana are the actual databases or services where the data is stored. Grafana has a variety of data source plugins that connect Grafana to different types of databases or services. This enables Grafana to query those sources from display that data on its dashboards. The data sources can be anything from traditional SQL databases to time-series databases or metrics, and logs from Axiom.

A Grafana data source plugin extends the functionality of Grafana by allowing it to interact with a specific type of data source. These plugins enable users to extract data from a variety of different sources, not just those that come supported by default in Grafana.

## Prerequisites

* [Create an Axiom account](https://app.axiom.co/register).
* [Create a dataset in Axiom](/reference/datasets#create-dataset) where you send your data.
* [Create an advanced API token in Axiom](/reference/tokens#create-advanced-api-token) with permissions to query data from the dataset you have created. Basic API tokens only allow data ingestion and won't work with Grafana.

## Install the Axiom Grafana data source plugin on Grafana Cloud

* In Grafana, click Administration > Plugins in the side navigation menu to view installed plugins.

* In the filter bar, search for the Axiom plugin

* Click on the plugin logo.

* Click Install.

<Frame caption="Add new layer">
  <img src="https://mintcdn.com/axiom/hZaY6OinxsdbIvKF/doc-assets/shots/6-grafana.png?fit=max&auto=format&n=hZaY6OinxsdbIvKF&q=85&s=f0cd534df4d90d89e98a62df0391feea" alt="Add new layer" width="1579" height="661" data-path="doc-assets/shots/6-grafana.png" />
</Frame>

When the update is complete, a confirmation message is displayed, indicating that the installation was successful.

* The Axiom Grafana Plugin is also installable from the [Grafana Plugins page](https://grafana.com/grafana/plugins/axiomhq-axiom-datasource/)

<Frame caption="Add new layer">
  <img src="https://mintcdn.com/axiom/hZaY6OinxsdbIvKF/doc-assets/shots/7-grafana.png?fit=max&auto=format&n=hZaY6OinxsdbIvKF&q=85&s=48aed6142486987f81bee114dd0e8ea3" alt="Add new layer" width="1226" height="756" data-path="doc-assets/shots/7-grafana.png" />
</Frame>

## Install the Axiom Grafana data source plugin on local Grafana

The Axiom data source plugin for Grafana is [open source on GitHub](https://github.com/axiomhq/axiom-grafana). It can be installed via the Grafana CLI, or via Docker.

### Install the Axiom Grafana Plugin using Grafana CLI

```bash theme={null}
grafana-cli plugins install axiomhq-axiom-datasource
```

### Install Via Docker

* Add the plugin to your `docker-compose.yml` or `Dockerfile`
* Set the environment variable `GF_INSTALL_PLUGINS` to include the plugin

Example:
`GF_INSTALL_PLUGINS="axiomhq-axiom-datasource"`

## Configuration

* Add a new data source in Grafana

* Select the Axiom data source type.

<Frame caption="Add new layer">
  <img src="https://mintcdn.com/axiom/hZaY6OinxsdbIvKF/doc-assets/shots/1-grafana.png?fit=max&auto=format&n=hZaY6OinxsdbIvKF&q=85&s=68c5d8eb534675574aadffbe8a611017" alt="Add new layer" width="2976" height="1668" data-path="doc-assets/shots/1-grafana.png" />
</Frame>

* Enter the previously generated API token.

* Save and test the data source.

## Build Queries with Query Editor

The Axiom data source Plugin provides a custom query editor to build and visualize your Axiom event data. After configuring the Axiom data source, start building visualizations from metrics and logs stored in Axiom.

* Create a new panel in Grafana by clicking on Add visualization

<Frame caption="Build queries">
  <img src="https://mintcdn.com/axiom/hZaY6OinxsdbIvKF/doc-assets/shots/2-grafana.png?fit=max&auto=format&n=hZaY6OinxsdbIvKF&q=85&s=1feed64d9b1c5d815a6d95d8ad09fad7" alt="Build queries" width="2982" height="1512" data-path="doc-assets/shots/2-grafana.png" />
</Frame>

* Select the Axiom data source.

<Frame caption="Axiom data source">
  <img src="https://mintcdn.com/axiom/hZaY6OinxsdbIvKF/doc-assets/shots/3-grafana.png?fit=max&auto=format&n=hZaY6OinxsdbIvKF&q=85&s=5101e6db9a4b2224068a8aaace88b4cd" alt="Axiom data source" width="2718" height="766" data-path="doc-assets/shots/3-grafana.png" />
</Frame>

* Use the query editor to choose the desired metrics, dimensions, and filters.

<Frame caption="Axiom Query Editor">
  <img src="https://mintcdn.com/axiom/ht_bivVnbPw26JRw/doc-assets/shots/axiom-aws-lambda-dashboard.png?fit=max&auto=format&n=ht_bivVnbPw26JRw&q=85&s=59d2724750ac177f0aa6c95ff00a1b4a" alt="Axiom Query Editor" width="2868" height="1500" data-path="doc-assets/shots/axiom-aws-lambda-dashboard.png" />
</Frame>

## Benefits of the Axiom Grafana data source plugin

The Axiom Grafana data source plugin allows users to display and interact with their Axiom data directly from within Grafana. By doing so, it provides several advantages:

1. **Unified visualization:** The Axiom Grafana data source plugin allows users to utilize Grafana’s powerful visualization tools with Axiom’s data. This enables users to create, explore, and share dashboards which visually represent their Axiom logs and metrics.

<Frame caption="Data visualisation">
  <img src="https://mintcdn.com/axiom/ht_bivVnbPw26JRw/doc-assets/shots/grafana-axiom-image-3.jpg?fit=max&auto=format&n=ht_bivVnbPw26JRw&q=85&s=1772cc2b83eb47c34d2d5454d3c51ed9" alt="Data visualisation" width="1404" height="1016" data-path="doc-assets/shots/grafana-axiom-image-3.jpg" />
</Frame>

2. **Rich Querying Capability:** Grafana has a powerful and flexible interface for building data queries. With the Axiom plugin, and leverage this capability to build complex queries against your Axiom data.

<Frame caption="Rich querying">
  <img src="https://mintcdn.com/axiom/ht_bivVnbPw26JRw/doc-assets/shots/grafana-axiom-image-1.jpg?fit=max&auto=format&n=ht_bivVnbPw26JRw&q=85&s=07176df87e3cfa8bd41232eeadf732a8" alt="Rich querying" width="1404" height="1016" data-path="doc-assets/shots/grafana-axiom-image-1.jpg" />
</Frame>

3. **Customizable Alerting:** Grafana’s alerting feature allows you to set alerts based on your queries' results, and set up custom alerts based on specific conditions in your Axiom log data.

4. **Sharing and Collaboration:** Grafana’s features for sharing and collaboration can help teams work together more effectively. Share Axiom data visualizations with others, collaborate on dashboards, and discuss insights directly in Grafana.

<Frame caption="Rich querying">
  <img src="https://mintcdn.com/axiom/ht_bivVnbPw26JRw/doc-assets/shots/grafana-axiom-image-2.jpg?fit=max&auto=format&n=ht_bivVnbPw26JRw&q=85&s=d87aaac872f51a82c5e168c41dbfaa63" alt="Rich querying" width="1404" height="1016" data-path="doc-assets/shots/grafana-axiom-image-2.jpg" />
</Frame>
