fix: improve tracing provider validation logic in OpsTraceManager (#20042)

This commit is contained in:
jameshui1997 2025-05-22 14:08:36 +08:00 committed by GitHub
parent 6f48af2610
commit 648393cc7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -292,11 +292,14 @@ class OpsTraceManager:
:return:
"""
# auth check
if tracing_provider is not None:
if enabled == True:
try:
provider_config_map[tracing_provider]
except KeyError:
raise ValueError(f"Invalid tracing provider: {tracing_provider}")
else:
if tracing_provider is not None:
raise ValueError(f"Invalid tracing provider: {tracing_provider}")
app_config: Optional[App] = db.session.query(App).filter(App.id == app_id).first()
if not app_config: