fix tracing flags

This commit is contained in:
Adil Hafeez 2026-02-07 15:16:12 -08:00
parent 509976dec6
commit 31f3d38fad
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
11 changed files with 61 additions and 48 deletions

View file

@ -6,6 +6,7 @@ import yaml
from jsonschema import validate
from urllib.parse import urlparse
from copy import deepcopy
from planoai.consts import DEFAULT_OTEL_TRACING_GRPC_ENDPOINT
SUPPORTED_PROVIDERS_WITH_BASE_URL = [
@ -158,6 +159,29 @@ def validate_and_render_schema():
arch_tracing = config_yaml.get("tracing", {})
opentracing_grpc_endpoint = arch_tracing.get(
"opentracing_grpc_endpoint", DEFAULT_OTEL_TRACING_GRPC_ENDPOINT
)
arch_tracing["opentracing_grpc_endpoint"] = opentracing_grpc_endpoint
# resolve env vars in opentracing_grpc_endpoint if present
if opentracing_grpc_endpoint and "$" in opentracing_grpc_endpoint:
opentracing_grpc_endpoint = os.path.expandvars(opentracing_grpc_endpoint)
print(
f"Resolved opentracing_grpc_endpoint to {opentracing_grpc_endpoint} after expanding environment variables"
)
arch_tracing["opentracing_grpc_endpoint"] = opentracing_grpc_endpoint
# ensure that opentracing_grpc_endpoint is a valid URL if present and start with http and must not have any path
if opentracing_grpc_endpoint:
urlparse_result = urlparse(opentracing_grpc_endpoint)
if urlparse_result.scheme != "http":
raise Exception(
f"Invalid opentracing_grpc_endpoint {opentracing_grpc_endpoint}, scheme must be http"
)
if urlparse_result.path and urlparse_result.path != "/":
raise Exception(
f"Invalid opentracing_grpc_endpoint {opentracing_grpc_endpoint}, path must be empty"
)
llms_with_endpoint = []
llms_with_endpoint_cluster_names = set()
updated_model_providers = []