Skip to content

Commit

Permalink
[QRadar v3] Metrics (demisto#34485)
Browse files Browse the repository at this point in the history
* init

* finally

* RN

* dashboard and widget

* fix

* revert

* pre-commit

* Update Packs/QRadar/pack_metadata.json

* rn and readme

* Update Packs/QRadar/Integrations/QRadar_v3/README.md

* Apply suggestions from code review

Co-authored-by: dorschw <[email protected]>

---------

Co-authored-by: dorschw <[email protected]>
  • Loading branch information
shmuel44 and dorschw authored Jun 10, 2024
1 parent 6cdf4f6 commit 4406202
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Packs/QRadar/Integrations/QRadar_v3/QRadar_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ def http_request(self, method: str, url_suffix: str, params: Optional[dict] = No
headers=headers,
error_handler=self.qradar_error_handler,
timeout=timeout or self.timeout,
resp_type=resp_type
resp_type=resp_type,
with_metrics=True
)
except (DemistoException, requests.ReadTimeout) as error:
demisto.error(f'Error {error} in time {_time}')
Expand Down Expand Up @@ -5336,6 +5337,11 @@ def main() -> None: # pragma: no cover
except Exception as e:
print_debug_msg(f"The integration context_data is {get_integration_context()}")
return_error(f'Failed to execute {demisto.command()} command.\nError:\n{traceback.format_exc()}\nException is: {str(e)}')
finally:
# CIAC-10628
if command not in ("test-module", "fetch-incidents", "long-running-execution"):
client._return_execution_metrics_results()
client.execution_metrics.metrics = None


''' ENTRY POINT '''
Expand Down
8 changes: 8 additions & 0 deletions Packs/QRadar/Integrations/QRadar_v3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ Alternatively, the [retrieve events command](#qradar-search-retrieve-events) can
If the command takes too long to finish executing, try setting the `interval_in_seconds` to a lower value (down to a minimum of 10 seconds).


### API Call Metrics

This feature collects metadata on QRadar API calls and their success status.

API Call metrics are not available for long-running commands such as `fetch incidents`.

API Metrics are shown in the built-in **API Execution Metrics** dashboard, and are available to use in custom widgets.

## Commands

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook.
Expand Down
6 changes: 6 additions & 0 deletions Packs/QRadar/ReleaseNotes/2_5_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### IBM QRadar v3

Added support for API Execution Metric reporting for QRadar commands, excluding long-running commands such as fetch incidents.
2 changes: 1 addition & 1 deletion Packs/QRadar/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "IBM QRadar",
"description": "Fetch offenses as incidents and search QRadar",
"support": "xsoar",
"currentVersion": "2.4.59",
"currentVersion": "2.5.0",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit 4406202

Please sign in to comment.