Skip to content

User-originated ConnectionError bubbles up to Flagsmith #7350

@sentry

Description

@sentry

Acceptance Criterion

  • Connection errors pushing events in the Grafana integration do not raise alerts in our issue tracking.

For better UX, we should somehow let the user know the integration didn't work as expected. Other platforms solve this problem by adding an "Integration log" tool to list requests and responses made, perhaps only their headers, with sensitive information redacted.


Sentry Issue: FLAGSMITH-API-5E1

gaierror: [Errno -2] Name or service not known
  File "urllib3/connection.py", line 204, in _new_conn
    sock = connection.create_connection(
  File "urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "socket.py", line 977, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

NameResolutionError: HTTPSConnection(host='grafana.example.com', port=443): Failed to resolve 'grafana.example.com' ([Errno -2] Name or service not known)
(1 additional frame(s) were not displayed)
...
  File "urllib3/connectionpool.py", line 488, in _make_request
    raise new_e
  File "urllib3/connectionpool.py", line 464, in _make_request
    self._validate_conn(conn)
  File "urllib3/connectionpool.py", line 1093, in _validate_conn
    conn.connect()
  File "urllib3/connection.py", line 759, in connect
    self.sock = sock = self._new_conn()
  File "urllib3/connection.py", line 211, in _new_conn
    raise NameResolutionError(self.host, self, e) from e

MaxRetryError: HTTPSConnectionPool(host='grafana.example.com', port=443): Max retries exceeded with url: /api/annotations (Caused by NameResolutionError("HTTPSConnection(host='grafana.example.com', port=443): Failed to resolve 'grafana.example.com' ([Errno -2] Name or service not known)"))
  File "requests/adapters.py", line 644, in send
    resp = conn.urlopen(
  File "urllib3/connectionpool.py", line 841, in urlopen
    retries = retries.increment(
  File "urllib3/util/retry.py", line 535, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]

ConnectionError: HTTPSConnectionPool(host='grafana.example.com', port=443): Max retries exceeded with url: /api/annotations (Caused by NameResolutionError("HTTPSConnection(host='grafana.example.com', port=443): Failed to resolve 'grafana.example.com' ([Errno -2] Name or service not known)"))
(3 additional frame(s) were not displayed)
...
  File "integrations/common/wrapper.py", line 22, in track_event_async
    self._track_event(event)
  File "integrations/grafana/grafana.py", line 35, in _track_event
    response = requests.post(

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions