Ad Widget

Collapse

Prometheus federate scraping

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gabbs
    Junior Member
    • Feb 2020
    • 11

    #1

    Prometheus federate scraping

    Hi,

    I am trying to use HTTP Agent to pull metrics out of a Prometheus server using its federation endpoint. I can’t reach all its scrape targets and collect metrics from every Node Exporter.

    I have set up an HTTP Agent item (on a Zabbix proxy host which is in the same network as my prometheus server) where the desired URL is

    http://prometheus:9090/federate?match[]={job=“my_job_name”}

    I also have Preprocessing step defined
    Prom to JSON => node_boot_time_seconds{instance=~".*"}

    If I supply the above to the URL entry box and save the item, then Zabbix accepts the item, the item becomes available.

    I can navigate to the same URL in a normal browser and verify that Prometheus responds correctly with the metrics for my prometheus "job" .
    I can also use curl on the Zabbix proxy to fetch the same
    curl -G 'http://prometheus:9090/federate' --data-urlencode 'match[]={job="my_job_name"}'

    Problem is that Zabbix however is not showing anything in latest data for that host and for that item.

    Another issue is, if in the HTTP Agent item I press the “Parse” button then Zabbix brakes the above mentioned URL to:

    URL: http://prometheus:9090/federate

    Query fields
    Name Value
    match[] {job <= this is not correct


    I have tried to use an encoded URL, but the Parsing function breaks it just like above
    http://prometheus:9090/federate?match[]={job=%22my_job_name%22}

    Any suggestion or experience with the above please?
    Thanks!
Working...