> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/management-and-administration/integrations/grafana.md).

# Grafana

You can send audit log notifications to Grafana as chart annotations. This Harness FME audit log webhook abridges notifications into chart annotations for Grafana. The annotations are tagged as 'split' so that a Grafana user can put an annotation query on any dashboard to see Harness FME notifications. You can read about [Grafana Chart Annotations](https://grafana.com/docs/grafana/latest/developers/http_api/annotations/). A single node.js lambda does the work for the integration, using only the filesystem (for API keys) and the Axios HTTP client. The integration receives audit log notifications, abridges them into new annotations, and calls the Grafana annotation API to create new annotations.

![](/files/X80EImRSHjZ2MYVDN3UU)

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Before you start, you should be familiar with AWS and working with Lambdas.

### Installing the Harness FME audit log webhook <a href="#installing-the-harness-fme-audit-log-webhook" id="installing-the-harness-fme-audit-log-webhook"></a>

The Harness FME audit log webhook is a node.js lambda, which is designed to be deployed in AWS. To install the webhook on your local environment, do the following:

1. Clone the [Split Grafana repository](https://github.com/splitio/split2grafana) in an empty directory.
2. In the directory, carefully copy your Grafana API key into a file called GRAFANA\_API\_KEY (I used admin role key).
3. Copy the host and port of your Grafana server into a file called GRAFANA\_URL.

   For example: <http://your.grafana.host.or.ip:3000>

   The default port is `3000`. Change this to the proper host and port of your Grafana server. The host must be accessible from AWS. Local installs won’t be visible to the integration lambda.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>NOTE</strong></p><p>Be sure you don’t copy or add a trailing slash. If you add an extra space or trailing slash at the end of the line, or empty lines after, the key won’t be recognized and the integration fails to run correctly. In addition, the file names must precisely be the names as shown above (written in capital letters).</p></div>
4. From this directory, use a terminal to do the following. If npm is not installed, you must install it:

### Creating an annotation query for tag split <a href="#creating-an-annotation-query-for-tag-split" id="creating-an-annotation-query-for-tag-split"></a>

You must create an annotation query for tag 'split' on the dashboards for where you want the Harness FME annotations to appear. Refer to the Grafana documentation for information about dashboard settings. Once you set this up, you see the following:

The following shows you an example of what you see when you click the Preview in dashboard button:

![](/files/23lqPiFz1ddS3Ri80x7H)

### Installing in AWS <a href="#installing-in-aws" id="installing-in-aws"></a>

To install Grafana in AWS, do the following:

1. Create a new "split2grafana" lambda for Nodes.js.
2. Upload grafana.zip to the Code screen of your AWS lambda.
3. Once you create a lambda, create a functional URL to POST to it.
4. Enable CORS and give the Allow Headers field a \*
5. Provide the functional URL to a new Harness FME audit log webhook.
6. Use the Harness FME webhook test button to make sure you get back a 200 response from your lambda.

### Debug <a href="#debug" id="debug"></a>

Use CloudWatch to look at inbound events and check they're properly handled. Incorrect key or Grafana server host and port are likely problems.

### About this integration <a href="#about-this-integration" id="about-this-integration"></a>

This is a third-party integration that has been tested by the Harness FME team. Harness does not own or maintain this integration. For more information, reach out to the [contributor](mailto:david.martin@split.io).

We encourage contribution for all third-party integrations. You can find the repo that backs this integration which is found in GitHub. To learn more about all our integrations, check out our [integrations](https://www.split.io/product/integrations) page. If you’d like a demo of Harness FME, or help to implement any of our integrations, contact <support@split.io>.
