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
{{ message }}
Repository navigation
A base_url without a scheme kills the sender thread and prints a traceback to stderr #3
If base_url has no scheme (for example TraceClient("trace.example.org", "app", key="k")), the sender thread dies on the first report and prints a traceback to the host program's stderr.
In trace_client/trace_client.py, _send() builds urllib.request.Request(...) before its try block. Request.__init__ parses the URL and raises ValueError: unknown url type: 'trace.example.org/api/metrics'. Nothing in _drain() catches that, so the daemon thread exits and threading's default excepthook writes the full traceback to stderr. Reproduced on Python 3.8.10:
Exception in thread trace-client/app:
Traceback (most recent call last):
...
File ".../trace_client/trace_client.py", line 184, in _send
request = urllib.request.Request(
...
ValueError: unknown url type: 'trace.example.org/api/metrics'
This breaks the documented promise that failures "are logged at DEBUG on the trace logger and otherwise not at all". Once the thread is dead, later reports also just fill the queue and get dropped.
Suggested fix: build the Request inside the existing try in _send(), so a malformed URL is logged at DEBUG as could not deliver and the thread keeps running. The constructor's behaviour stays the same: it does not start raising for URLs it used to accept.
Activity