Pass through organization/project headers to tracing backend, fix speech_group enum (#562)

This commit is contained in:
Steven Heidel 2025-04-21 13:59:46 -07:00 committed by GitHub
parent 942ba9840b
commit 2bdf9b7b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View file

@ -137,9 +137,10 @@ class _MCPServerWithClientSession(MCPServer, abc.ABC):
async with self._cleanup_lock:
try:
await self.exit_stack.aclose()
self.session = None
except Exception as e:
logger.error(f"Error cleaning up server: {e}")
finally:
self.session = None
class MCPServerStdioParams(TypedDict):

View file

@ -102,6 +102,12 @@ class BackendSpanExporter(TracingExporter):
"OpenAI-Beta": "traces=v1",
}
if self.organization:
headers["OpenAI-Organization"] = self.organization
if self.project:
headers["OpenAI-Project"] = self.project
# Exponential backoff loop
attempt = 0
delay = self.base_delay

View file

@ -338,7 +338,7 @@ class SpeechGroupSpanData(SpanData):
@property
def type(self) -> str:
return "speech-group"
return "speech_group"
def export(self) -> dict[str, Any]:
return {