getsentry / getsentry/sentry-python

Capture HTTP request/response headers on outbound http.client spans

未關閉
#5,935 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Feature Python Spans
主要語言
Python
星號
2.2k
分支
669
平均合併
1 天 1 小時
30 天內合併 PR
213

描述

### Problem Statement

The Python SDK currently captures HTTP request/response headers for incoming server requests (e.g., in Django, aiohttp server handlers), but does not capture any headers on outbound http.client spans.

For outbound HTTP calls, only method, URL, query string, fragment, status code, and reason are recorded. Users debugging issues with external API calls would benefit from seeing request and response headers on these spans as well.

This applies to all HTTP client integrations: aiohttp, httpx, stdlib/httplib, and pyreqwest.

### Solution Brainstorm

Add opt-in support for capturing HTTP request and response headers on outbound http.client spans. The existing _filter_headers / SENSITIVE_HEADERS mechanism used for incoming request headers could be reused to scrub sensitive values (Authorization, Cookie, etc.) before attaching headers to outbound spans. The send_default_pii flag could control whether scrubbing is applied, consistent with how incoming headers are handled today.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。