> 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

Send Harness FME audit log notifications to Grafana as chart annotations using a Node.js Lambda and the Grafana annotation API.

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.

![](https://1473625385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrT2RGHAjtBTaObzchfpb%2Fuploads%2Fgit-blob-9d734c947d5759f9cf6d9c702e78af38596da135%2Fgrafana-chart.png?alt=media)

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

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

## Install the Harness FME audit log webhook <a href="#install-the-harness-fme-audit-log-webhook" id="install-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 will not 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 do not 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 will not 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:

## Create an annotation query for the split tag <a href="#create-an-annotation-query-for-the-split-tag" id="create-an-annotation-query-for-the-split-tag"></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:

![](https://1473625385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrT2RGHAjtBTaObzchfpb%2Fuploads%2Fgit-blob-19078a9c62853e511746dd1c2baad2bb6947f9ae%2Fgrafana-annotations.png?alt=media)

## Install in AWS <a href="#install-in-aws" id="install-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 are 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, contact [Harness Support](/feature-management-experimentation/troubleshooting-and-resources/fme-support.md).

If you would like a demo of Harness FME or help to implement any of its integrations, contact [Harness Support](/feature-management-experimentation/troubleshooting-and-resources/fme-support.md).

Harness FME welcomes contributions to all third-party integrations. Go to [Integrations](/feature-management-experimentation/management-and-administration/integrations.md) to review all available integrations.

{% @harness-feedback/feedback %}
