faucet.gauge_prom module

Prometheus for Gauge.

class faucet.gauge_prom.GaugeFlowTablePrometheusPoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugeFlowTablePoller

Export flow table entries to Prometheus.

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

class faucet.gauge_prom.GaugePortStatePrometheusPoller(conf, logname, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePortStatePoller

Export port state changes to Prometheus.

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

class faucet.gauge_prom.GaugePortStatsPrometheusPoller(conf, logger, prom_client)[source]

Bases: faucet.gauge_pollers.GaugePortStatsPoller

Exports port stats to Prometheus.

update(rcv_time, dp_id, msg)[source]

Handle the responses to requests.

Called when a reply to a stats request sent by this object is received by the controller.

It should acknowledge the receipt by setting self.reply_pending to false.

Parameters
  • rcv_time – the time the response was received

  • dp_id – DP ID

  • msg – the stats reply message

class faucet.gauge_prom.GaugePrometheusClient(reg=None)[source]

Bases: faucet.prom_client.PromClient

Wrapper for Prometheus client that is shared between all pollers.

reregister_flow_vars(table_name, table_tags)[source]

Register the flow variables needed for this client

faucet.gauge_prom.PROM_FLOW_VARS = ('flow_byte_count', 'flow_packet_count')
faucet.gauge_prom.PROM_PORT_PREFIX = 'of_port'
faucet.gauge_prom.PROM_PORT_STATE_VARS = ('reason', 'state', 'curr_speed', 'max_speed')
faucet.gauge_prom.PROM_PORT_VARS = ('tx_packets', 'rx_packets', 'tx_bytes', 'rx_bytes', 'tx_dropped', 'rx_dropped', 'rx_errors')
faucet.gauge_prom.PROM_PREFIX_DELIM = '_'