Commit cce3bb22 authored by Konstantinos Poulakakis's avatar Konstantinos Poulakakis
Browse files

feat: add metallb configuration. Uncomment metrics logs and values.

parent c13aa29d
Loading
Loading
Loading
Loading

metallb.yaml

0 → 100644
+14 −0
Original line number Diff line number Diff line
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: my-ip-pool
  namespace: metallb-system
spec:
  addresses:
    - 192.168.5.250-192.168.5.251  # <-- Change this to match your network
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: l2-adv
  namespace: metallb-system
+43 −43
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ class INTCollector(_Collector):
    def create_descriptors_and_send_to_kafka(self, flow_info , service_id , context_id):
        LOGGER.debug(f"PACKET FROM SWITCH: {flow_info.switch_id} LATENCY: {flow_info.hop_latency}")
        if(self.table.get(flow_info.switch_id) == None):
            # seq_num_kpi_id     = str(uuid4())
            seq_num_kpi_id     = str(uuid4())
            ingress_ts_kpi_id  = str(uuid4())
            egress_ts_kpi_id   = str(uuid4())
            hop_lat_kpi_id     = str(uuid4())
@@ -230,24 +230,24 @@ class INTCollector(_Collector):
            is_drop_kpi_id     = str(uuid4())
            sw_lat_kpi_id      = str(uuid4())

            # LOGGER.debug(f"seq_num_kpi_id     for switch {flow_info.switch_id}: {seq_num_kpi_id}")
            # LOGGER.debug(f"ingress_ts_kpi_id  for switch {flow_info.switch_id}: {ingress_ts_kpi_id}")
            # LOGGER.debug(f"egress_ts_kpi_id   for switch {flow_info.switch_id}: {egress_ts_kpi_id}")
            # LOGGER.debug(f"hop_lat_kpi_id     for switch {flow_info.switch_id}: {hop_lat_kpi_id}")
            # LOGGER.debug(f"ing_port_id_kpi_id for switch {flow_info.switch_id}: {ing_port_id_kpi_id}")
            # LOGGER.debug(f"egr_port_id_kpi_id for switch {flow_info.switch_id}: {egr_port_id_kpi_id}")
            # LOGGER.debug(f"queue_occup_kpi_id for switch {flow_info.switch_id}: {queue_occup_kpi_id}")
            # LOGGER.debug(f"is_drop_kpi_id     for switch {flow_info.switch_id}: {is_drop_kpi_id}")
            # LOGGER.debug(f"sw_lat_kpi_id      for switch {flow_info.switch_id}: {sw_lat_kpi_id}")

            # seq_num_kpi           = self.set_kpi_descriptor(seq_num_kpi_id,     service_id ,'', '', KpiSampleType.KPISAMPLETYPE_INT_SEQ_NUM)
            # ingress_timestamp_kpi = self.set_kpi_descriptor(ingress_ts_kpi_id,  service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_TS_ING)
            # egress_timestamp_kpi  = self.set_kpi_descriptor(egress_ts_kpi_id,   service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_TS_EGR)
            # hop_latency_kpi       = self.set_kpi_descriptor(hop_lat_kpi_id,     service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_HOP_LAT)
            # ingress_port_id_kpi   = self.set_kpi_descriptor(ing_port_id_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_PORT_ID_ING)
            # egress_port_id_kpi    = self.set_kpi_descriptor(egr_port_id_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_PORT_ID_EGR)
            # queue_occup_kpi       = self.set_kpi_descriptor(queue_occup_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_QUEUE_OCCUP)
            # is_drop_kpi           = self.set_kpi_descriptor(is_drop_kpi_id,     service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_IS_DROP)
            LOGGER.debug(f"seq_num_kpi_id     for switch {flow_info.switch_id}: {seq_num_kpi_id}")
            LOGGER.debug(f"ingress_ts_kpi_id  for switch {flow_info.switch_id}: {ingress_ts_kpi_id}")
            LOGGER.debug(f"egress_ts_kpi_id   for switch {flow_info.switch_id}: {egress_ts_kpi_id}")
            LOGGER.debug(f"hop_lat_kpi_id     for switch {flow_info.switch_id}: {hop_lat_kpi_id}")
            LOGGER.debug(f"ing_port_id_kpi_id for switch {flow_info.switch_id}: {ing_port_id_kpi_id}")
            LOGGER.debug(f"egr_port_id_kpi_id for switch {flow_info.switch_id}: {egr_port_id_kpi_id}")
            LOGGER.debug(f"queue_occup_kpi_id for switch {flow_info.switch_id}: {queue_occup_kpi_id}")
            LOGGER.debug(f"is_drop_kpi_id     for switch {flow_info.switch_id}: {is_drop_kpi_id}")
            LOGGER.debug(f"sw_lat_kpi_id      for switch {flow_info.switch_id}: {sw_lat_kpi_id}")

            seq_num_kpi           = self.set_kpi_descriptor(seq_num_kpi_id,     service_id ,'', '', KpiSampleType.KPISAMPLETYPE_INT_SEQ_NUM)
            ingress_timestamp_kpi = self.set_kpi_descriptor(ingress_ts_kpi_id,  service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_TS_ING)
            egress_timestamp_kpi  = self.set_kpi_descriptor(egress_ts_kpi_id,   service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_TS_EGR)
            hop_latency_kpi       = self.set_kpi_descriptor(hop_lat_kpi_id,     service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_HOP_LAT)
            ingress_port_id_kpi   = self.set_kpi_descriptor(ing_port_id_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_PORT_ID_ING)
            egress_port_id_kpi    = self.set_kpi_descriptor(egr_port_id_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_PORT_ID_EGR)
            queue_occup_kpi       = self.set_kpi_descriptor(queue_occup_kpi_id, service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_QUEUE_OCCUP)
            is_drop_kpi           = self.set_kpi_descriptor(is_drop_kpi_id,     service_id, '', '', KpiSampleType.KPISAMPLETYPE_INT_IS_DROP)

            # Set a dedicated KPI descriptor for every switch
            sw_lat_kpi = None
@@ -265,25 +265,25 @@ class INTCollector(_Collector):

            # Gather keys and values
            keys   = [
                # seq_num_kpi.kpi_id.uuid,
                # ingress_timestamp_kpi.kpi_id.uuid,
                # egress_timestamp_kpi.kpi_id.uuid,
                # hop_latency_kpi.kpi_id.uuid,
                # ingress_port_id_kpi.kpi_id.uuid,
                # egress_port_id_kpi.kpi_id.uuid,
                # queue_occup_kpi.kpi_id.uuid,
                # is_drop_kpi.kpi_id.uuid,
                seq_num_kpi.kpi_id.uuid,
                ingress_timestamp_kpi.kpi_id.uuid,
                egress_timestamp_kpi.kpi_id.uuid,
                hop_latency_kpi.kpi_id.uuid,
                ingress_port_id_kpi.kpi_id.uuid,
                egress_port_id_kpi.kpi_id.uuid,
                queue_occup_kpi.kpi_id.uuid,
                is_drop_kpi.kpi_id.uuid,
                sw_lat_kpi.kpi_id.uuid
            ]
            values = [
                # flow_info.seq_num,
                # flow_info.ingress_timestamp,
                # flow_info.egress_timestamp,
                # flow_info.hop_latency,
                # flow_info.ingress_port_id,
                # flow_info.egress_port_id,
                # flow_info.queue_occupancy,
                # flow_info.is_drop,
                flow_info.seq_num,
                flow_info.ingress_timestamp,
                flow_info.egress_timestamp,
                flow_info.hop_latency,
                flow_info.ingress_port_id,
                flow_info.egress_port_id,
                flow_info.queue_occupancy,
                flow_info.is_drop,
                flow_info.hop_latency
            ]
            assert len(keys) == len(values), "KPI keys and values must agree"
@@ -296,14 +296,14 @@ class INTCollector(_Collector):
                self.send_message_to_kafka(key, value)
        else:
            values = [
                # flow_info.seq_num,
                # flow_info.ingress_timestamp,
                # flow_info.egress_timestamp,
                # flow_info.hop_latency,
                # flow_info.ingress_port_id,
                # flow_info.egress_port_id,
                # flow_info.queue_occupancy,
                # flow_info.is_drop,
                flow_info.seq_num,
                flow_info.ingress_timestamp,
                flow_info.egress_timestamp,
                flow_info.hop_latency,
                flow_info.ingress_port_id,
                flow_info.egress_port_id,
                flow_info.queue_occupancy,
                flow_info.is_drop,
                flow_info.hop_latency
            ]
            switch = self.table.get(flow_info.switch_id)