Add new infra architecture
This commit is contained in:
@@ -63,6 +63,13 @@ class OTelConfig:
|
||||
# Clean and parse base endpoint
|
||||
base_grpc = cls._clean_grpc_endpoint(base_endpoint)
|
||||
base_http_host = cls._extract_host(base_endpoint)
|
||||
|
||||
# Validate that the endpoint doesn't contain secret references or malformed data
|
||||
if cls._contains_secret_reference(base_grpc):
|
||||
logger.error("OTEL endpoint contains secret reference, falling back to default",
|
||||
malformed_endpoint=base_endpoint)
|
||||
base_grpc = f"{cls.DEFAULT_OTEL_COLLECTOR_HOST}:{cls.DEFAULT_GRPC_PORT}"
|
||||
base_http_host = f"http://{cls.DEFAULT_OTEL_COLLECTOR_HOST}:{cls.DEFAULT_HTTP_PORT}"
|
||||
else:
|
||||
# Use default collector
|
||||
base_grpc = f"{cls.DEFAULT_OTEL_COLLECTOR_HOST}:{cls.DEFAULT_GRPC_PORT}"
|
||||
@@ -73,9 +80,9 @@ class OTelConfig:
|
||||
metrics_endpoint = os.getenv("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT", base_grpc)
|
||||
logs_endpoint = os.getenv("OTEL_EXPORTER_OTLP_LOGS_ENDPOINT")
|
||||
|
||||
# Build final endpoints
|
||||
traces_grpc = cls._clean_grpc_endpoint(traces_endpoint)
|
||||
metrics_grpc = cls._clean_grpc_endpoint(metrics_endpoint)
|
||||
# Validate and clean signal-specific endpoints
|
||||
traces_grpc = cls._clean_and_validate_grpc_endpoint(traces_endpoint)
|
||||
metrics_grpc = cls._clean_and_validate_grpc_endpoint(metrics_endpoint)
|
||||
|
||||
# For metrics HTTP, convert gRPC endpoint to HTTP if needed
|
||||
metrics_http = cls._grpc_to_http_endpoint(metrics_grpc, "/v1/metrics")
|
||||
|
||||
Reference in New Issue
Block a user