diff --git a/plugins/fluentd_telemetry_plugin/src/app.py b/plugins/fluentd_telemetry_plugin/src/app.py index 112adb25..923b4fa4 100644 --- a/plugins/fluentd_telemetry_plugin/src/app.py +++ b/plugins/fluentd_telemetry_plugin/src/app.py @@ -22,12 +22,10 @@ from web_service import UFMTelemetryFluentdStreamingAPI from streamer import UFMTelemetryStreaming from streaming_config_parser import UFMTelemetryStreamingConfigParser -from telemetry_constants import UFMTelemetryConstants from streaming_scheduler import StreamingScheduler # pylint: disable=no-name-in-module,import-error from utils.flask_server import run_api -from utils.args_parser import ArgsParser from utils.logger import Logger from utils.utils import Utils @@ -45,7 +43,6 @@ def _init_logs(config_parser): if __name__ == '__main__': # init app config parser & load config files - # args = ArgsParser.parse_args("UFM Telemetry Streaming to fluentd", UFMTelemetryConstants.args_list) _config_parser = UFMTelemetryStreamingConfigParser() _init_logs(_config_parser) diff --git a/plugins/fluentd_telemetry_plugin/src/telemetry_attributes_manager.py b/plugins/fluentd_telemetry_plugin/src/telemetry_attributes_manager.py index abbb87ca..b90c8502 100644 --- a/plugins/fluentd_telemetry_plugin/src/telemetry_attributes_manager.py +++ b/plugins/fluentd_telemetry_plugin/src/telemetry_attributes_manager.py @@ -2,6 +2,10 @@ from utils.utils import Utils class TelemetryAttributesManager: + """" + UFM TelemetryAttributesManager class - to manager streaming attributes + When we parse the telemetry data, we should update saved/cached attributes (headers) and file (/config/tfs_streaming_attributes.json) + """ def __init__(self): self.streaming_attributes_file = "/config/tfs_streaming_attributes.json" # this path on the docker diff --git a/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py b/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py index 0c8b3c30..b09a0dbd 100644 --- a/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py +++ b/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py @@ -5,10 +5,12 @@ from ufm_sdk_tools.src.xdr_utils import PortType,prepare_port_type_http_telemetry_filter from utils.logger import Logger, LOG_LEVELS from telemetry_constants import UFMTelemetryConstants -from telemetry_attributes_manager import TelemetryAttributesManager from utils.utils import Utils class TelemetryParser: + """ + UFM TelemetryParser class - to fetch and parse the telemetry data + """ PORT_CONSTANTS_KEYS = { 'timestamp': 'timestamp', 'source_id': 'source_id', 'tag': 'tag', @@ -156,7 +158,7 @@ def _parse_telemetry_csv_metrics_to_json_with_delta(self, available_headers, row is_constant_value = TelemetryParser.PORT_CONSTANTS_KEYS.get(key) if value: # the value of this counter not empty - value = self._convert_str_to_num(value) + value = TelemetryParser._convert_str_to_num(value) if is_constant_value is None and value != current_port_values.get(key): # the value was changed -> stream it dic[key] = value @@ -230,7 +232,7 @@ def _parse_telemetry_csv_metrics_to_json_without_delta(self, available_headers, value = values[i] key = available_headers[i] if value: - port_record[key] = self._convert_str_to_num(value) + port_record[key] = TelemetryParser._convert_str_to_num(value) self.last_streamed_data_sample_per_endpoint[endpoint_key][port_key] = port_record if is_meta_fields_available: port_record = self._append_meta_fields_to_dict(port_record)