I have to collect data from a software package, that only provides an prometheus exporter. I have assumed, that this is possible with the [input.prometheus] plugin, but after some tests, it seems more like this plugin is only able to collect data from an prometheus server.
Maybe I’m wrong, but the documentation is very thin at this topic, so it would be great to get a more detailed advise how to collect the data with telegraf to store it within an InfluxDB
Maybe I can use another plugin?
In the documentation they state the following, what is maybe helpful.
For each service, metrics are available via the built-in HTTP server on the /prometheus page (for
example http: //registry:7871/prometheus). The format is the Prometheus Text format 0.0.4 which
is documented here.
Hello @SWalter,
Thanks for your question. Have you taken a look at the markdown on git for the prometheus plugin? You can scrape metrics from an endpoint. It also has service discovery for Kubernetes to build that list dynamically.
What documentation are you looking at? Clearly, we need to update that info.
Is that what you’re looking for?
Also with Influx 2.0, you can use a scrape function and bypass telegraf altogether. Let me know what you decide to use. If you decide to use telegraf, and are still having trouble please share your config so we can debug it. Thanks
I have had checked already the telegraf prometheus plugin documentation on github, but I am not really able to understand it. Yet I am even not sure, if the plugin interacts with a prometheus exporter/endpoint or a prometheus server instance.
I don’t know any other documentation for the telegraf plugin. So if there is anything else, please share it. I also tried to google some examples, but failed.
Influx2.0 is not really an option for us, since we have now just influx1.7.1 in place and plan to update to the newest version. Maybe 2.0 is something within one or two years, but not now.
We got some short description from the third party software developers, that I have attached. In general I would assume, that it is possible to use this provided information two write a valid telegraf config and then gather all the data, but I failed…
11.4 Prometheus
For advanced monitoring purposes, XXX services and clients export their metrics for consumption
by external monitoring systems.
For each service, metrics are available via the built-in HTTP server on the /prometheus page (for
example http: //registry:7871/prometheus). The format is the Prometheus Text format 0.0.4 which
is documented here.
This format can be consumed by Prometheus 1.x and 2.x, but also other monitoring systems are
able to scrape Prometheus targets. XXX Registry services also export a minimal Consul-like
service discovery interface that allows Prometheus to automatically discovery XXX services
and clients.
11.4.1 Prometheus Configuration Example
An example Prometheus conguration which lists services individually looks like this:
@SWalter,
The prometheus input plugin gathers metrics from HTTP servers exposing metrics in Prometheus format.
In order to use telegraf you need to:
-install it
-generate a telegraf config file with your desired input and output plugins
Then you need to edit the config:
-so that you’re scraping metrics from the correct url under the INPUTS PLUGIN section
-that you’re writing data to the correct OUTPUTS
finally, you can run telegraf with your desired config with
telegraf --config telegraf.conf
I also recommend setting debug=true in the telegraf config to help you debug.
Ok, I have found a mistake. The port is 7871 not 8071. But even now the result ist the same.
2019-11-19T09:15:00Z E! [inputs.prometheus]: Error in plugin: error making HTTP request to http:admin1:7871/prometheus: Get http:admin1:7871/prometheus: http: no Host in request URL
But if I use my browser and go to admin1:7871/prometheus I see the monitoring data. Also with 10.10.1.1:7871/prometheus
@SWalter, this is what your third party developers wrote about service discovery in the software:
XXX Registry services also export a minimal Consul-like service discovery interface that allows Prometheus to automatically discovery XXX services and clients.
Consul is a piece of software made by Hashicorp which provides, among other things, service discovery functionality. It sounds like the software you are using provides a compatible service. Unfortunately, service discovery using Consul is not currently supported in Telegraf, although there is an open issue which discusses the possible addition of this functionality in the future.
Hey @noahcrowley@SWalter. I have a related issue. I found this thread on a google search and thought would reach out here for some help. When I try to use this plug-in, the telegraf always complains about no input plug-in provided. Any idea why that happens? Does this plug-in have to be updated in any telegraf configs? Please advise