Skip to content

charoensri/ThreadDumpAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pega API to dump threads - using Invoke-WebRequest -Uri "$BaseUrl/prweb/api/v1/nodes/$WebNode/diagnostics/thread_dump"

Shell terminal:
PowerShell.exe -ExecutionPolicy Bypass



PS C:\0-sc\TDTools> .\threads-dump-oauth2.ps1 -BaseUrl "https://<HOST>" -WebNode "pega-web-5dd6b6754f-7zspb" -Iterations 5 -ClientId "<YOUR Pega Client Registration ClientID>" -ClientSecret "YOUR Pega Client Registration Secret" -TokenEndpoint "https://<host>/prweb/PRRestService/oauth2/v1/token"
Obtaining OAuth2 token using client credentials flow...
Successfully obtained OAuth2 token
Logging script activity to logs\pega-web-5dd6b6754f-7zspb_thread_dump_log_20250915_114703.txt
2025-09-15 11:47:03 - Script started with OAuth2 Bearer token authentication
2025-09-15 11:47:03 - Base URL: https://comaus-acres-STG2.pega.net
2025-09-15 11:47:03 - Web Node: pega-web-5dd6b6754f-7zspb
2025-09-15 11:47:03 - Iterations: 5
2025-09-15 11:47:03 - Starting iteration 1 of 5
2025-09-15 11:47:03 - Saving thread dump to logs\pega-web-5dd6b6754f-7zspb_20250915_114703.zip
2025-09-15 11:47:03 - Attempt 1 - Making API request...
2025-09-15 11:47:04 - Saved successfully: logs\pega-web-5dd6b6754f-7zspb_20250915_114703.zip (Size: 58862 bytes)
2025-09-15 11:47:04 - Waiting 5 seconds before next iteration...
2025-09-15 11:47:09 - Starting iteration 2 of 5
2025-09-15 11:47:09 - Saving thread dump to logs\pega-web-5dd6b6754f-7zspb_20250915_114709.zip
2025-09-15 11:47:09 - Attempt 1 - Making API request...
2025-09-15 11:47:12 - Saved successfully: logs\pega-web-5dd6b6754f-7zspb_20250915_114709.zip (Size: 59594 bytes)
2025-09-15 11:47:12 - Waiting 5 seconds before next iteration...
2025-09-15 11:47:17 - Starting iteration 3 of 5
2025-09-15 11:47:17 - Saving thread dump to logs\pega-web-5dd6b6754f-7zspb_20250915_114717.zip
2025-09-15 11:47:17 - Attempt 1 - Making API request...
2025-09-15 11:47:19 - Saved successfully: logs\pega-web-5dd6b6754f-7zspb_20250915_114717.zip (Size: 56944 bytes)
2025-09-15 11:47:19 - Waiting 5 seconds before next iteration...
2025-09-15 11:47:24 - Starting iteration 4 of 5
2025-09-15 11:47:24 - Saving thread dump to logs\pega-web-5dd6b6754f-7zspb_20250915_114724.zip
2025-09-15 11:47:24 - Attempt 1 - Making API request...
2025-09-15 11:47:25 - Saved successfully: logs\pega-web-5dd6b6754f-7zspb_20250915_114724.zip (Size: 59905 bytes)
2025-09-15 11:47:25 - Waiting 5 seconds before next iteration...
2025-09-15 11:47:30 - Starting iteration 5 of 5
2025-09-15 11:47:30 - Saving thread dump to logs\pega-web-5dd6b6754f-7zspb_20250915_114730.zip
2025-09-15 11:47:30 - Attempt 1 - Making API request...
2025-09-15 11:47:32 - Saved successfully: logs\pega-web-5dd6b6754f-7zspb_20250915_114730.zip (Size: 57000 bytes)
2025-09-15 11:47:32 - Creating archive: pega-web-5dd6b6754f-7zspb_thread_dumps_20250915_114732.zip
2025-09-15 11:47:32 - Compressed logs into archive: pega-web-5dd6b6754f-7zspb_thread_dumps_20250915_114732.zip
2025-09-15 11:47:32 - Individual dump files removed. Archive and log file remain.
2025-09-15 11:47:32 - Script completed.
PS C:\0-sc\TDTools>

For Pega BasicAuth user/pwd
./threads-dump-pwsh.ps1 -BaseUrl "https://<HOST>" -WebNode "pega-web-5f76988bfc-gz4wv" -Iterations 5 -DelayInSeconds 5 -MaxRetries 3

PS C:\0-sc\TDTools> ./threads-dump-pwsh.ps1 -BaseUrl "https://<HOST>" -WebNode "pega-web-5f76988bfc-gz4wv" -Iterations 5 -DelayInSeconds 5 -MaxRetries 3
Logging script activity to pega-web-5f76988bfc-gz4wv_thread_dump_log_20250914_140958.txt
2025-09-14 14:09:58 - Starting iteration 1 of 5
2025-09-14 14:09:58 - Saving thread dump to logs\pega-web-5f76988bfc-gz4wv_20250914_140958.zip
2025-09-14 14:10:02 - Saved successfully: logs\pega-web-5f76988bfc-gz4wv_20250914_140958.zip
2025-09-14 14:10:07 - Starting iteration 2 of 5
2025-09-14 14:10:07 - Saving thread dump to logs\pega-web-5f76988bfc-gz4wv_20250914_141007.zip
2025-09-14 14:10:09 - Saved successfully: logs\pega-web-5f76988bfc-gz4wv_20250914_141007.zip
2025-09-14 14:10:14 - Starting iteration 3 of 5
2025-09-14 14:10:14 - Saving thread dump to logs\pega-web-5f76988bfc-gz4wv_20250914_141014.zip
2025-09-14 14:10:16 - Saved successfully: logs\pega-web-5f76988bfc-gz4wv_20250914_141014.zip
2025-09-14 14:10:21 - Starting iteration 4 of 5
2025-09-14 14:10:21 - Saving thread dump to logs\pega-web-5f76988bfc-gz4wv_20250914_141021.zip
2025-09-14 14:10:23 - Saved successfully: logs\pega-web-5f76988bfc-gz4wv_20250914_141021.zip
2025-09-14 14:10:28 - Starting iteration 5 of 5
2025-09-14 14:10:28 - Saving thread dump to logs\pega-web-5f76988bfc-gz4wv_20250914_141028.zip
2025-09-14 14:10:30 - Saved successfully: logs\pega-web-5f76988bfc-gz4wv_20250914_141028.zip
2025-09-14 14:10:35 - Compressed logs into archive: pega-web-5f76988bfc-gz4wv_thread_dumps_20250914_141035.zip
2025-09-14 14:10:35 - Individual log files removed. Only archive remains.
2025-09-14 14:10:35 - Script completed successfully.
PS C:\0-sc\TDTools>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published