This commit is contained in:
2026-01-24 17:54:04 +01:00
parent c98f9b99f5
commit 85c756d89a

View File

@@ -157,6 +157,30 @@ class OTelConfig:
return endpoint
@classmethod
def _clean_and_validate_grpc_endpoint(cls, endpoint: str) -> str:
"""
Clean and validate a gRPC endpoint.
Args:
endpoint: Raw endpoint string
Returns:
Cleaned and validated endpoint in format "host:port"
"""
# First clean the endpoint
cleaned = cls._clean_grpc_endpoint(endpoint)
# Validate it doesn't contain secret references
if cls._contains_secret_reference(cleaned):
logger.warning(
"Endpoint contains secret reference, using default",
original=endpoint
)
return f"{cls.DEFAULT_OTEL_COLLECTOR_HOST}:{cls.DEFAULT_GRPC_PORT}"
return cleaned
@staticmethod
def _extract_host(endpoint: str) -> str:
"""