Loading manifests/telemetryservice.yaml +7 −1 Original line number Diff line number Diff line Loading @@ -94,10 +94,16 @@ metadata: labels: app: telemetryservice spec: type: ClusterIP type: LoadBalancer loadBalancerIP: 192.168.5.250 externalTrafficPolicy: Local selector: app: telemetryservice ports: - name: dnsudp protocol: UDP port: 12345 targetPort: 12345 - name: grpc protocol: TCP port: 30050 Loading proto/kpi_sample_types.proto +34 −9 Original line number Diff line number Diff line Loading @@ -49,4 +49,29 @@ enum KpiSampleType { KPISAMPLETYPE_BYTES_DROPPED_AGG_OUTPUT = 1203; KPISAMPLETYPE_SERVICE_LATENCY_MS_AGG_OUTPUT = 1701; // INT KPIs KPISAMPLETYPE_INT_SEQ_NUM = 2001; KPISAMPLETYPE_INT_TS_ING = 2002; KPISAMPLETYPE_INT_TS_EGR = 2003; KPISAMPLETYPE_INT_HOP_LAT = 2004; KPISAMPLETYPE_INT_PORT_ID_ING = 2005; KPISAMPLETYPE_INT_PORT_ID_EGR = 2006; KPISAMPLETYPE_INT_QUEUE_OCCUP = 2007; KPISAMPLETYPE_INT_QUEUE_ID = 2008; KPISAMPLETYPE_INT_HOP_LAT_SW01 = 2101; KPISAMPLETYPE_INT_HOP_LAT_SW02 = 2102; KPISAMPLETYPE_INT_HOP_LAT_SW03 = 2103; KPISAMPLETYPE_INT_HOP_LAT_SW04 = 2104; KPISAMPLETYPE_INT_HOP_LAT_SW05 = 2105; KPISAMPLETYPE_INT_HOP_LAT_SW06 = 2106; KPISAMPLETYPE_INT_HOP_LAT_SW07 = 2107; KPISAMPLETYPE_INT_HOP_LAT_SW08 = 2108; KPISAMPLETYPE_INT_HOP_LAT_SW09 = 2109; KPISAMPLETYPE_INT_HOP_LAT_SW10 = 2110; KPISAMPLETYPE_INT_LAT_ON_TOTAL = 2120; KPISAMPLETYPE_INT_IS_DROP = 2201; KPISAMPLETYPE_INT_DROP_REASON = 2202; } proto/telemetry_frontend.proto +15 −7 Original line number Diff line number Diff line Loading @@ -35,6 +35,14 @@ message Collector { float interval_s = 4; // Interval between collected samples context.Timestamp start_time = 5; // Timestamp when Collector start execution context.Timestamp end_time = 6; // Timestamp when Collector stop execution INTCollector int_collector = 7; // Extra optional information about INT collectors } message INTCollector { int32 transport_port = 1; // The port where the collector listens to packets string interface = 2; // Network interface to collect data from string service_id = 3; // Service identifier related to this collector string context_id = 4; // Context identifier related to this collector } message CollectorFilter { Loading src/kpi_value_writer/service/MetricWriterToPrometheus.py +6 −8 Original line number Diff line number Diff line Loading @@ -51,10 +51,10 @@ class MetricWriterToPrometheus: 'slice_id' : kpi_descriptor.slice_id.slice_uuid.uuid, 'connection_id' : kpi_descriptor.connection_id.connection_uuid.uuid, 'link_id' : kpi_descriptor.link_id.link_uuid.uuid, 'time_stamp' : kpi_value.timestamp.timestamp, #'time_stamp' : kpi_value["time_stamp"], 'kpi_value' : kpi_value.kpi_value_type.floatVal #'kpi_value' : kpi_value["kpi_value"] # 'time_stamp' : kpi_value.timestamp.timestamp, 'time_stamp' : kpi_value["time_stamp"], # 'kpi_value' : kpi_value.kpi_value_type.floatVal 'kpi_value' : kpi_value["kpi_value"] } LOGGER.debug("Cooked Kpi: {:}".format(cooked_kpi)) return cooked_kpi Loading Loading @@ -89,7 +89,6 @@ class MetricWriterToPrometheus: # Push to the Prometheus Gateway, Prometheus is preconfigured to scrap the metrics from the gateway push_to_gateway(self.gateway_url, job=self.job_name, registry=self.registry) LOGGER.debug("Metric pushed to Prometheus Gateway.") except ValueError as e: if 'Duplicated timeseries' in str(e): LOGGER.debug("Metric {:} is already registered. Skipping.".format(metric_name)) Loading @@ -97,4 +96,3 @@ class MetricWriterToPrometheus: else: LOGGER.error("Error while pushing metric: {}".format(e)) raise src/telemetry/backend/Dockerfile +5 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install wget g++ git && \ apt-get --yes --quiet --quiet install wget g++ git libpcap-dev && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur Loading @@ -31,6 +31,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade setuptools wheel RUN python3 -m pip install --upgrade pip-tools RUN python3 -m pip install --upgrade scapy # Get common Python packages # Note: this step enables sharing the previous Docker build steps among all the Python components Loading Loading @@ -76,6 +77,9 @@ COPY src/vnt_manager/__init__.py vnt_manager/__init__.py COPY src/vnt_manager/client/. vnt_manager/client/ COPY src/telemetry/__init__.py telemetry/__init__.py COPY src/telemetry/backend/. telemetry/backend/ COPY src/analytics/__init__.py analytics/__init__.py COPY src/analytics/frontend/__init__.py analytics/frontend/__init__.py COPY src/analytics/frontend/client/. analytics/frontend/client/ # Start the service ENTRYPOINT ["python", "-m", "telemetry.backend.service"] Loading
manifests/telemetryservice.yaml +7 −1 Original line number Diff line number Diff line Loading @@ -94,10 +94,16 @@ metadata: labels: app: telemetryservice spec: type: ClusterIP type: LoadBalancer loadBalancerIP: 192.168.5.250 externalTrafficPolicy: Local selector: app: telemetryservice ports: - name: dnsudp protocol: UDP port: 12345 targetPort: 12345 - name: grpc protocol: TCP port: 30050 Loading
proto/kpi_sample_types.proto +34 −9 Original line number Diff line number Diff line Loading @@ -49,4 +49,29 @@ enum KpiSampleType { KPISAMPLETYPE_BYTES_DROPPED_AGG_OUTPUT = 1203; KPISAMPLETYPE_SERVICE_LATENCY_MS_AGG_OUTPUT = 1701; // INT KPIs KPISAMPLETYPE_INT_SEQ_NUM = 2001; KPISAMPLETYPE_INT_TS_ING = 2002; KPISAMPLETYPE_INT_TS_EGR = 2003; KPISAMPLETYPE_INT_HOP_LAT = 2004; KPISAMPLETYPE_INT_PORT_ID_ING = 2005; KPISAMPLETYPE_INT_PORT_ID_EGR = 2006; KPISAMPLETYPE_INT_QUEUE_OCCUP = 2007; KPISAMPLETYPE_INT_QUEUE_ID = 2008; KPISAMPLETYPE_INT_HOP_LAT_SW01 = 2101; KPISAMPLETYPE_INT_HOP_LAT_SW02 = 2102; KPISAMPLETYPE_INT_HOP_LAT_SW03 = 2103; KPISAMPLETYPE_INT_HOP_LAT_SW04 = 2104; KPISAMPLETYPE_INT_HOP_LAT_SW05 = 2105; KPISAMPLETYPE_INT_HOP_LAT_SW06 = 2106; KPISAMPLETYPE_INT_HOP_LAT_SW07 = 2107; KPISAMPLETYPE_INT_HOP_LAT_SW08 = 2108; KPISAMPLETYPE_INT_HOP_LAT_SW09 = 2109; KPISAMPLETYPE_INT_HOP_LAT_SW10 = 2110; KPISAMPLETYPE_INT_LAT_ON_TOTAL = 2120; KPISAMPLETYPE_INT_IS_DROP = 2201; KPISAMPLETYPE_INT_DROP_REASON = 2202; }
proto/telemetry_frontend.proto +15 −7 Original line number Diff line number Diff line Loading @@ -35,6 +35,14 @@ message Collector { float interval_s = 4; // Interval between collected samples context.Timestamp start_time = 5; // Timestamp when Collector start execution context.Timestamp end_time = 6; // Timestamp when Collector stop execution INTCollector int_collector = 7; // Extra optional information about INT collectors } message INTCollector { int32 transport_port = 1; // The port where the collector listens to packets string interface = 2; // Network interface to collect data from string service_id = 3; // Service identifier related to this collector string context_id = 4; // Context identifier related to this collector } message CollectorFilter { Loading
src/kpi_value_writer/service/MetricWriterToPrometheus.py +6 −8 Original line number Diff line number Diff line Loading @@ -51,10 +51,10 @@ class MetricWriterToPrometheus: 'slice_id' : kpi_descriptor.slice_id.slice_uuid.uuid, 'connection_id' : kpi_descriptor.connection_id.connection_uuid.uuid, 'link_id' : kpi_descriptor.link_id.link_uuid.uuid, 'time_stamp' : kpi_value.timestamp.timestamp, #'time_stamp' : kpi_value["time_stamp"], 'kpi_value' : kpi_value.kpi_value_type.floatVal #'kpi_value' : kpi_value["kpi_value"] # 'time_stamp' : kpi_value.timestamp.timestamp, 'time_stamp' : kpi_value["time_stamp"], # 'kpi_value' : kpi_value.kpi_value_type.floatVal 'kpi_value' : kpi_value["kpi_value"] } LOGGER.debug("Cooked Kpi: {:}".format(cooked_kpi)) return cooked_kpi Loading Loading @@ -89,7 +89,6 @@ class MetricWriterToPrometheus: # Push to the Prometheus Gateway, Prometheus is preconfigured to scrap the metrics from the gateway push_to_gateway(self.gateway_url, job=self.job_name, registry=self.registry) LOGGER.debug("Metric pushed to Prometheus Gateway.") except ValueError as e: if 'Duplicated timeseries' in str(e): LOGGER.debug("Metric {:} is already registered. Skipping.".format(metric_name)) Loading @@ -97,4 +96,3 @@ class MetricWriterToPrometheus: else: LOGGER.error("Error while pushing metric: {}".format(e)) raise
src/telemetry/backend/Dockerfile +5 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install wget g++ git && \ apt-get --yes --quiet --quiet install wget g++ git libpcap-dev && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur Loading @@ -31,6 +31,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade setuptools wheel RUN python3 -m pip install --upgrade pip-tools RUN python3 -m pip install --upgrade scapy # Get common Python packages # Note: this step enables sharing the previous Docker build steps among all the Python components Loading Loading @@ -76,6 +77,9 @@ COPY src/vnt_manager/__init__.py vnt_manager/__init__.py COPY src/vnt_manager/client/. vnt_manager/client/ COPY src/telemetry/__init__.py telemetry/__init__.py COPY src/telemetry/backend/. telemetry/backend/ COPY src/analytics/__init__.py analytics/__init__.py COPY src/analytics/frontend/__init__.py analytics/frontend/__init__.py COPY src/analytics/frontend/client/. analytics/frontend/client/ # Start the service ENTRYPOINT ["python", "-m", "telemetry.backend.service"]