You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure agent exits if process receives SIGINT or SIGTERM signal (#100)
Ensure that the agent process exits if the process receives a `SIGINT`
or `SIGTERM` signal.
**Tests:**
- Validate process will exit if TTY is set:
- Created a new Ubuntu arm64 VM
- Built agent with `make docker-build`
- Ran agent in VM and sent a `Ctrl-C` signal
- Confirmed agent process exited
- Validate process will exit when run as daemon:
- Created a new Ubuntu arm64 VM
- Built agent with `make docker-build`
- Added a new `.service` file
- Reloaded systemd configuration with `systemctl daemon-reload`
- Enabled service with `systemctl enable postman-insights-agent.service`
- Confirmed successful daemon startup with `journalctl -fu
postman-insights-agent.service`
- Sent SIGINT signal with `kill -2 {process-id}`
- Confirmed agent process exited
**Logs:**
*Interactive (TTY is set) logs:*
```sh
dev@ubuntu-insights-agent:~$ sudo POSTMAN_API_KEY=$INSIGHTS_KEY ./postman-insights-agent apidump --project $PROJECT_ID
[INFO] Telemetry unavailable; no Amplitude key configured.
[INFO] This is caused by building from source rather than using an official build.
[INFO] Postman Insights Agent 0.0.0
[INFO] Created new trace on Postman Cloud: akita://Test Project:trace:aquamarine-mark-f6c0e9b5
[INFO] Failed to clear VmHWM. Memory usage telemetry will report the high-water mark as computed by /proc/self/status.
[INFO] Running learn mode on interfaces lo, enp0s5
[INFO] --filter flag is not set; capturing all network traffic to and from your services.
[INFO] Send SIGINT (Ctrl-C) to stop...
^C[INFO] Received interrupt, stopping trace collection...
[INFO] Trace collection stopped
[INFO] Captured 454 TCP packets total; 301 unparsed TCP segments. No TLS headers were found, so this may represent a network protocol that the agent does not know how to parse.
[ERROR] No HTTP calls captured! 🛑
```
*Systemd daemon logs:*
```sh
Mar 26 20:01:32 ubuntu-insights-agent systemd[1]: Started postman-insights-agent.service - Postman Insights Agent.
Mar 26 20:01:32 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Telemetry unavailable; no Amplitude key configured.
Mar 26 20:01:32 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] This is caused by building from source rather than using an official build.
Mar 26 20:01:32 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Postman Insights Agent 0.0.0
Mar 26 20:01:33 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Created new trace on Postman Cloud: akita://Test Project:trace:tree-lady-44b4e9a1
Mar 26 20:01:33 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Failed to clear VmHWM. Memory usage telemetry will report the high-water mark as computed by /proc/self/status.
Mar 26 20:01:33 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Running learn mode on interfaces lo, enp0s5
Mar 26 20:01:33 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] --filter flag is not set; capturing all network traffic to and from your services.
Mar 26 20:01:33 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Send SIGINT (Ctrl-C) to stop...
Mar 26 20:02:25 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Received interrupt, stopping trace collection...
Mar 26 20:02:30 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Trace collection stopped
Mar 26 20:02:30 ubuntu-insights-agent postman-insights-agent[5069]: [INFO] Captured 2 TLS handshake messages out of 6997 total TCP segments. This may mean you are trying to capture HTTPS traffic, which is currently unsupported.
Mar 26 20:02:30 ubuntu-insights-agent postman-insights-agent[5069]: [ERROR] No HTTP calls captured! 🛑
Mar 26 20:02:30 ubuntu-insights-agent systemd[1]: postman-insights-agent.service: Deactivated successfully.
Mar 26 20:02:30 ubuntu-insights-agent systemd[1]: postman-insights-agent.service: Consumed 1.703s CPU time, 48.1M memory peak, 0B memory swap peak.
```
0 commit comments