<p>Currently I have a Kubernetes environment and using Py rometheus toolkit for monitoring. I have application counters which are not exposed in container metrics. However I am able to view them as a JSON object by using a curl command. </p>

<p><a href="http://10.0.0.1:8081/api/events/" rel="nofollow noreferrer">http://10.0.0.1:8081/api/events/</a></p>

<p>I have used NodePort to expose POD externally via worker nodes's IP. </p>

<p>Response has the following format:</p>

<pre><code>{
{
  "ID":   "001",
  "source": "pageloads",
  "summary":  "high failure counts",
  "severity": "major"
},
{
  "ID":   "003",
  "source": "profile_counts",
  "summary":  "profile count doesn't match number of groups",
  "severity": "minor"
},
{
  "ID":   "002",
  "source": "number of subscribers",
  "summary":  "profiles higher than subscribers",
  "severity": "critical"
}
}
</code></pre>

<p>Is there a way to include API response in Prometheus to poll every 15 seconds?</p>

Peter Smith
<p>That json response is not in prometheus <a href="https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md" rel="noreferrer">format</a> , hence prometheus will not be able to scrape that.You will need to use the language specific prometheus client library to instrument your code to expose metrics in prometheus format at /metrics endpoint.If that's not possible then you need to use an existing <a href="https://prometheus.io/docs/instrumenting/exporters/" rel="noreferrer">exporter</a> or write a custom exporter.This exporter runs as a separate process and will collect metrics from your application api endpoint and create prometheus format metrics and expose those metrics at /metrics endpoint.Then you can configure prometheus to scrape the exporter's /metrics endpoint. </p>
