Metrics Path

463 views
Skip to first unread message

Juan Escudero

unread,
Nov 15, 2017, 1:13:28 PM11/15/17
to Prometheus Users
Hi,

Below is my prometheus.yml file.  I have the metrics_path set to /node and /snmp.

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
    metrics_path: /node
  - job_name: 'node_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9100']       

  - job_name: 'floor_switches'
    scrape_interval: 1m
    static_configs:
      - targets: ['192.168.2'.45, '192.168.2'.46']
    metrics_path: /snmp
    params:
      module: [if_mib,cisco_wlc]  
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9116  # SNMP exporter

 When i go to http://servername/(9090 or 9100)/(node or snmp) i get a page that says.



Metrics( this will send me back to http://servername/(9090 or 9100)/metrics.  Is this correct.  Shouldnt i see the data that i am collecting instead.


i have also tested with port 9116


Thx for your help in advance

Brian Brazil

unread,
Nov 15, 2017, 1:15:55 PM11/15/17
to Juan Escudero, Prometheus Users
On 15 November 2017 at 18:13, Juan Escudero <juan.esc...@gmail.com> wrote:
Hi,

Below is my prometheus.yml file.  I have the metrics_path set to /node and /snmp.

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
    metrics_path: /node

This is not the endpoint that Prometheus serves metrics on, leave this to the default of /metrics.

Brian
 
  - job_name: 'node_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9100']       

  - job_name: 'floor_switches'
    scrape_interval: 1m
    static_configs:
      - targets: ['192.168.2'.45, '192.168.2'.46']
    metrics_path: /snmp
    params:
      module: [if_mib,cisco_wlc]  
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9116  # SNMP exporter

 When i go to http://servername/(9090 or 9100)/(node or snmp) i get a page that says.



Metrics( this will send me back to http://servername/(9090 or 9100)/metrics.  Is this correct.  Shouldnt i see the data that i am collecting instead.


i have also tested with port 9116


Thx for your help in advance

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dd67a53d-ed64-41d5-a3ec-417e6990d9d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Juan Escudero

unread,
Nov 15, 2017, 1:51:43 PM11/15/17
to Prometheus Users
Ok i set it back to /metrics.  thx for clarifying that.

what is the point of setting the metrics path /something .  i thought it was so you can see the metrics being collected by the jobs 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--

Ben Kochie

unread,
Nov 15, 2017, 2:54:36 PM11/15/17
to Juan Escudero, Prometheus Users
On Wed, Nov 15, 2017 at 7:51 PM, Juan Escudero <juan.esc...@gmail.com> wrote:
Ok i set it back to /metrics.  thx for clarifying that.

what is the point of setting the metrics path /something .  i thought it was so you can see the metrics being collected by the jobs 

Prometheus collects metrics by making http requests to remote targets.  The default URL is "target:port/metrics".

The results are stored in the database and can be queried on the Prometheus server web UI, or via the API using things like Grafana.
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/986af4a7-a445-4b43-bdf7-c46d923eaf84%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages