title: Creating an API to connect between ArangoDB and Prometheus to get the metrics of the data inside ArangoDB and expose it in Prometheus
body: <p>I am trying to creating an API to connect between ArangoDB and Prometheus. I have a statistics of the data in the ArangoDB for example, how many times the simulation has been launched that I want to see in Prometheus. Therefore I would like to confirm the following questions if it is correct as I understood:</p>
  <ol>
  <li>I checked the getting started guide of Prometheus (<a href="https://prometheus.io/docs/prometheus/latest/getting_started/" rel="nofollow noreferrer">https://prometheus.io/docs/prometheus/latest/getting_started/</a>) where we use node_exporter metrics in Prometheus. We need to launch this node_exporter and expose it on a specific IP address and port (listen address) then we need to configure the target in Prometheus config to target these ports that node_exporter is running on. Therefore, for my API, I need to create an API and app in Golang and this API/App need to be exposed in the specific HTTP port (for example 8001), then in Prometheus, I need to add the target for 8001 port in order for Prometheus to be able to scrape on my API. Is that correct?</li>
  <li>I need to find out the data format that Prometheus understand. I need to define the data format between my API (coming out from API) and Prometheus (coming into Prometheus). I found from this documentation (<a href="https://prometheus.io/docs/instrumenting/exposition_formats/" rel="nofollow noreferrer">https://prometheus.io/docs/instrumenting/exposition_formats/</a>) that it's the text format in this form:</li>
  </ol>
  <pre><code>metric_name [ &quot;{&quot; label_name &quot;=&quot; `&quot;` label_value `&quot;` { &quot;,&quot; label_name &quot;=&quot; `&quot;` label_value `&quot;` } [ &quot;,&quot; ] &quot;}&quot; ] value [ timestamp ]
  </code></pre>
  <p>Is this correct? Could you please confirm my understanding?</p>
  <p>Finally, it would be great if you can recommend me a source where someone has already done this kind of API to connect between ArangoDB and Prometheus. It would really help me to get started on this project. Thank you so much in advance.</p>