Loading .gitignore +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,8 @@ cython_debug/ # Sqlite *.db #temp files to test telemetry src/telemetry/backend/tempFiles/ # TeraFlowSDN-generated files tfs_runtime_env_vars.sh tfs_runtime_env_vars*.sh Loading manifests/telemetryservice.yaml +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ metadata: app: telemetryservice spec: type: LoadBalancer loadBalancerIP: 192.168.5.250 loadBalancerIP: _LOAD_BALANCER_IP_ externalTrafficPolicy: Local selector: app: telemetryservice Loading proto/kpi_sample_types.proto +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum KpiSampleType { KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_OPTICAL_POWER_TOTAL_INPUT = 502; KPISAMPLETYPE_OPTICAL_TOTAL_INPUT_POWER = 503; KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601; KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602; Loading src/telemetry/backend/service/collectors/gnmi_oc/GnmiOpenConfigCollector.py +4 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class GNMIOpenConfigCollector(_Collector): ========================= Lightweight wrapper around *pygnmi* with subscribe / get / unsubscribe helpers. """ def __init__(self, address: str = '', port: int = -1, **setting) -> None: def __init__(self, address: str = "", port: int = -1, **setting) -> None: super().__init__('gNMI_openconfig_collector', address, port, **setting) self._subscriptions : Dict[str, Subscription] = {} Loading @@ -51,13 +51,15 @@ class GNMIOpenConfigCollector(_Collector): self._output_queue = queue.Queue() # Queue for telemetry updates self.logger = logging.getLogger(__name__) self.logger.debug("GNMICollector instantiated.") self.logger.info("GNMICollector instantiated.") def Connect(self) -> bool: """ Connect to the gNMI target device. """ self.logger.info("Connecting to gNMI target %s:%s with username '%s'", self.address, self.port, self.username) if not self.connected: self.client = gNMIclient( target = (self.address, self.port), Loading src/telemetry/backend/service/collectors/gnmi_oc/SubscriptionNew.py +3 −5 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ class Subscription: LOGGER.debug("Sub %s stop requested, breaking stream loop", self.sub_id) break LOGGER.debug("Sub %s received stream message: %s", self.sub_id, stream) LOGGER.info("Sub %s received stream message: %s", self.sub_id, stream) # DEBUG: Check if update has actual update messages if stream.HasField("update"): Loading Loading @@ -269,12 +269,10 @@ class Subscription: LOGGER.debug("Sub %s cancelled (channel closed) - graceful shutdown", self.sub_id) break elif err.code() == grpc.StatusCode.INVALID_ARGUMENT: LOGGER.warning("Path '%s' rejected (%s) -- trying next", path, err.details()) LOGGER.warning("Path '%s' rejected (%s) -- trying next", path, err.details()) continue else: LOGGER.exception("Subscription %s hit gRPC error: %s", # Change with TFS Exception self.sub_id, err) LOGGER.exception("Subscription %s hit gRPC error: %s", self.sub_id, err) # Change with TFS Exception break except Exception as exc: # pylint: disable=broad-except Loading Loading
.gitignore +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,8 @@ cython_debug/ # Sqlite *.db #temp files to test telemetry src/telemetry/backend/tempFiles/ # TeraFlowSDN-generated files tfs_runtime_env_vars.sh tfs_runtime_env_vars*.sh Loading
manifests/telemetryservice.yaml +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ metadata: app: telemetryservice spec: type: LoadBalancer loadBalancerIP: 192.168.5.250 loadBalancerIP: _LOAD_BALANCER_IP_ externalTrafficPolicy: Local selector: app: telemetryservice Loading
proto/kpi_sample_types.proto +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ enum KpiSampleType { KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_OPTICAL_POWER_TOTAL_INPUT = 502; KPISAMPLETYPE_OPTICAL_TOTAL_INPUT_POWER = 503; KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601; KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602; Loading
src/telemetry/backend/service/collectors/gnmi_oc/GnmiOpenConfigCollector.py +4 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class GNMIOpenConfigCollector(_Collector): ========================= Lightweight wrapper around *pygnmi* with subscribe / get / unsubscribe helpers. """ def __init__(self, address: str = '', port: int = -1, **setting) -> None: def __init__(self, address: str = "", port: int = -1, **setting) -> None: super().__init__('gNMI_openconfig_collector', address, port, **setting) self._subscriptions : Dict[str, Subscription] = {} Loading @@ -51,13 +51,15 @@ class GNMIOpenConfigCollector(_Collector): self._output_queue = queue.Queue() # Queue for telemetry updates self.logger = logging.getLogger(__name__) self.logger.debug("GNMICollector instantiated.") self.logger.info("GNMICollector instantiated.") def Connect(self) -> bool: """ Connect to the gNMI target device. """ self.logger.info("Connecting to gNMI target %s:%s with username '%s'", self.address, self.port, self.username) if not self.connected: self.client = gNMIclient( target = (self.address, self.port), Loading
src/telemetry/backend/service/collectors/gnmi_oc/SubscriptionNew.py +3 −5 Original line number Diff line number Diff line Loading @@ -229,7 +229,7 @@ class Subscription: LOGGER.debug("Sub %s stop requested, breaking stream loop", self.sub_id) break LOGGER.debug("Sub %s received stream message: %s", self.sub_id, stream) LOGGER.info("Sub %s received stream message: %s", self.sub_id, stream) # DEBUG: Check if update has actual update messages if stream.HasField("update"): Loading Loading @@ -269,12 +269,10 @@ class Subscription: LOGGER.debug("Sub %s cancelled (channel closed) - graceful shutdown", self.sub_id) break elif err.code() == grpc.StatusCode.INVALID_ARGUMENT: LOGGER.warning("Path '%s' rejected (%s) -- trying next", path, err.details()) LOGGER.warning("Path '%s' rejected (%s) -- trying next", path, err.details()) continue else: LOGGER.exception("Subscription %s hit gRPC error: %s", # Change with TFS Exception self.sub_id, err) LOGGER.exception("Subscription %s hit gRPC error: %s", self.sub_id, err) # Change with TFS Exception break except Exception as exc: # pylint: disable=broad-except Loading