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

# Prometheus

Prometheus.io is an open-source monitoring and alerting toolkit widely used in the IT industry, empowering organizations to gather and analyze metrics from their systems to ensure optimal performance and reliability.

The integration between **Prometheus** and **Togai** requires only a one-time setup. Follow the steps below:

## Install

* Navigate to the Integrations section from the left navigation bar in Togai
* Click on `Apps` to access the list of apps with integration support
* Select `Prometheus` from the available apps
* Click on the `+Add connection` button
* Provide a name for the connection and paste your:
  * `Base URL`

### Base URL

<img src="https://mintcdn.com/zuora-togai/gpDI_SmUijp8C7vA/docs/integrations/images/prometheus-graph-screen.png?fit=max&auto=format&n=gpDI_SmUijp8C7vA&q=85&s=ab9d4ef23bcb7786fecd180e0b86917d" alt="Prometheus Graph Screen" width="3448" height="2156" data-path="docs/integrations/images/prometheus-graph-screen.png" />

* Obtain the network address of your Prometheus instance. This is the address you use to access the Prometheus server. It is usually in the format `http://<prometheus-server-ip>:<prometheus-service-port>`. For example, `http://localhost:9090` when running locally.
* Paste the network address in the `Base URL` field in Togai.

<Tip>
  In order to access the Prometheus server from outside the local network, you need to expose the Prometheus server port. You can use a tool like [ngrok](https://ngrok.com/) to expose the Prometheus server port.
</Tip>

## Flows

### 1. Ingest data from Prometheus

* The flow can be triggered by on demand triggered.
* Create flow connection by choosing the appropriate app connections from the dropdown.
  <img src="https://mintcdn.com/zuora-togai/gpDI_SmUijp8C7vA/docs/integrations/images/prometheus-trigger-now-btn.png?fit=max&auto=format&n=gpDI_SmUijp8C7vA&q=85&s=cffdbff37cb6fec0f854e837328f04a4" alt="Trigger Now Button" width="2962" height="1434" data-path="docs/integrations/images/prometheus-trigger-now-btn.png" />
* Once the flow connection is created, navigate to `Flow connections` on the top navigation bar and click on the `Trigger now` button to trigger the flow.
  <img src="https://mintcdn.com/zuora-togai/gpDI_SmUijp8C7vA/docs/integrations/images/prometheus-trigger-payload.png?fit=max&auto=format&n=gpDI_SmUijp8C7vA&q=85&s=d0a5fbf676bd6f3a8f9d36800aecc09d" alt="Trigger Payload" width="1526" height="1248" data-path="docs/integrations/images/prometheus-trigger-payload.png" />
* The flow takes an array of queries:
  * `query`: The query to be executed on the Prometheus server, usually the remaining part of the URL after the base URL.
  * `schemaKey`: The schema key to be used to map the data from Prometheus to the Togai Event Schema.
  * `accountKey`: The account key to be used to map the data to corresponding Togai Accounts to which the data belongs to.
  * `attributeName`: The attribute name of a Togai Event Schema to which the queried data should be mapped to.
* The flow will ingest the data from Prometheus as events into Togai.
