Reputation: 21
Did anyone know if it is possible to collect metric directly by sending a prometheus query in telegraf to VictoriaMetrics ?
I have tried this but it is not working :/
[inputs]
[[inputs.prometheus]]
urls = ["http://my_db_address:8428"]
query = "ifHCOutOctets_counter{target="device"}"
Any ideas ? Thanks !
Upvotes: 2
Views: 505
Reputation: 17784
Try the following config for Telegraf:
[[inputs.prometheus]]
urls = ["http://my_db_address:8428/federate?match[]=ifHCOutOctets_counter{target='device'}"]
It uses /federate endpoint for obtaining the last values for metrics matching the given filters. The /federate
endpoint returns metrics in the same format as usual Prometheus exporters do at /metrics
page.
Upvotes: 0
Reputation: 1
Make sure Prometheus query is valid data in system.if issue persists victoria metrics logs connection problem.Adusjust query with single quotes.Not use double quotes.
Upvotes: 0