What logging or monitoring strategies can help me pinpoint the exact cause of "HTTPSConnectionPool host='api.segment.io' port 443" errors more effectively?

Question

Grade: Education Subject: Support
What logging or monitoring strategies can help me pinpoint the exact cause of "HTTPSConnectionPool host='api.segment.io' port 443" errors more effectively?
Asked by:
155 Viewed 155 Answers

Answer (155)

Best Answer
(613)
Implement detailed logging for network requests in your application, including retry attempts and full exception tracebacks. Utilize Python's `logging` module and consider setting `logging.basicConfig(level=logging.DEBUG)` for the `requests` and `urllib3` libraries to get verbose output on connection attempts and SSL handshakes. On the server, monitor network traffic using tools like `tcpdump` or Wireshark to observe packets attempting to reach `api.segment.io` and identify where they might be dropped or rejected. Cloud environments often provide network flow logs that can also be invaluable for diagnosis.