diff --git a/plugins/fluentd_telemetry_plugin/src/schemas/set_conf.schema.json b/plugins/fluentd_telemetry_plugin/src/schemas/set_conf.schema.json index 67c4e157..0ea74033 100644 --- a/plugins/fluentd_telemetry_plugin/src/schemas/set_conf.schema.json +++ b/plugins/fluentd_telemetry_plugin/src/schemas/set_conf.schema.json @@ -54,12 +54,7 @@ }, "message_tag_name": { "type": "string" - }, - "timeout": { - "type": "integer", - "minimum": 1, - "err_message": "[telemetry-endpoint - timeout] attribute should be an integer greater than 0" - } + } }, "required": [ "host", @@ -125,6 +120,11 @@ }, "enabled": { "type": "boolean" + }, + "telemetry_request_timeout": { + "type": "integer", + "minimum": 1, + "err_message": "[streaming - telemetry_request_timeout] attribute should be an integer greater than 0" } } }, diff --git a/plugins/fluentd_telemetry_plugin/src/streaming_config_parser.py b/plugins/fluentd_telemetry_plugin/src/streaming_config_parser.py index b69f811b..7ab670d7 100644 --- a/plugins/fluentd_telemetry_plugin/src/streaming_config_parser.py +++ b/plugins/fluentd_telemetry_plugin/src/streaming_config_parser.py @@ -23,7 +23,6 @@ class UFMTelemetryStreamingConfigParser(ConfigParser): UFM_TELEMETRY_ENDPOINT_SECTION_XDR_MODE = "xdr_mode" UFM_TELEMETRY_ENDPOINT_SECTION_XDR_PORTS_TYPE = "xdr_ports_types" UFM_TELEMETRY_ENDPOINT_SECTION_XDR_PORTS_TYPE_SPLITTER = ";" - UFM_TELEMETRY_ENDPOINT_SECTION_TIMEOUT = "timeout" FLUENTD_ENDPOINT_SECTION = "fluentd-endpoint" FLUENTD_ENDPOINT_SECTION_HOST = "host" @@ -37,6 +36,7 @@ class UFMTelemetryStreamingConfigParser(ConfigParser): STREAMING_SECTION_STREAM_ONLY_NEW_SAMPLES = "stream_only_new_samples" STREAMING_SECTION_ENABLE_CACHED_STREAM_ON_TELEMETRY_FAIL = "enable_cached_stream_on_telemetry_fail" STREAMING_SECTION_ENABLED = "enabled" + STREAMING_SECTION_TELEMETRY_REQUEST_TIMEOUT = "TELEMETRY_REQUEST_TIMEOUT" META_FIELDS_SECTION = "meta-fields" @@ -72,10 +72,10 @@ def get_ufm_telemetry_xdr_ports_types(self): self.UFM_TELEMETRY_ENDPOINT_SECTION, self.UFM_TELEMETRY_ENDPOINT_SECTION_XDR_PORTS_TYPE, "legacy;aggregated;plane") - def get_telemetry_timeout(self): + def get_streaming_telemetry_request_timeout(self): return self.safe_get_int(None, - self.UFM_TELEMETRY_ENDPOINT_SECTION, - self.UFM_TELEMETRY_ENDPOINT_SECTION_TIMEOUT, + self.STREAMING_SECTION, + self.STREAMING_SECTION_TELEMETRY_REQUEST_TIMEOUT, 60) def get_streaming_interval(self): return self.get_config_value(None, diff --git a/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py b/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py index c5e1fb7b..601e288a 100644 --- a/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py +++ b/plugins/fluentd_telemetry_plugin/src/telemetry_parser.py @@ -75,7 +75,7 @@ def get_metrics(self, _host, _port, _url, msg_tag): url = f'http://{_host}:{_port}/{_url}' logging.info('Send UFM Telemetry Endpoint Request, Method: GET, URL: %s', url) try: - response = requests.get(url, timeout=self.config_parser.get_telemetry_timeout()) + response = requests.get(url, timeout=self.config_parser.get_streaming_telemetry_request_timeout()) response.raise_for_status() actual_content_size = len(response.content) expected_content_size = int(response.headers.get('Content-Length', actual_content_size))