diff --git a/autoblocks/_impl/config/constants.py b/autoblocks/_impl/config/constants.py index 78e68d6a..b6d83d96 100644 --- a/autoblocks/_impl/config/constants.py +++ b/autoblocks/_impl/config/constants.py @@ -1,5 +1,7 @@ +from autoblocks._impl.util import AutoblocksEnvVar + API_ENDPOINT = "https://api.autoblocks.ai" -API_ENDPOINT_V2 = "https://api-v2.autoblocks.ai" +API_ENDPOINT_V2 = AutoblocksEnvVar.V2_API_ENDPOINT_V2.get() or "https://api-v2.autoblocks.ai" INGESTION_ENDPOINT = "https://ingest-event.autoblocks.ai" REVISION_LATEST = "latest" REVISION_UNDEPLOYED = "undeployed" diff --git a/autoblocks/_impl/tracer/auto_tracer.py b/autoblocks/_impl/tracer/auto_tracer.py index 0953e321..4b4e087a 100644 --- a/autoblocks/_impl/tracer/auto_tracer.py +++ b/autoblocks/_impl/tracer/auto_tracer.py @@ -24,7 +24,6 @@ def init_auto_tracer( *, api_key: Optional[str] = None, - api_endpoint: Optional[str] = f"{API_ENDPOINT_V2}/otel/v1/traces", is_batch_disabled: Optional[bool] = False, ) -> None: """ @@ -33,6 +32,7 @@ def init_auto_tracer( if is_auto_tracer_initialized(): log.debug("Skipping auto tracer initialization because it is already initialized") return + api_endpoint = f"{API_ENDPOINT_V2}/otel/v1/traces" log.debug(f"Initializing Autoblocks auto tracer with api_endpoint={api_endpoint}") set_global_textmap( CompositePropagator( diff --git a/autoblocks/_impl/util.py b/autoblocks/_impl/util.py index 65099e4c..8c69f782 100644 --- a/autoblocks/_impl/util.py +++ b/autoblocks/_impl/util.py @@ -76,6 +76,7 @@ class AutoblocksEnvVar(StrEnum): ALIGN_TEST_EXTERNAL_ID = "AUTOBLOCKS_ALIGN_TEST_EXTERNAL_ID" API_KEY = "AUTOBLOCKS_API_KEY" V2_API_KEY = "AUTOBLOCKS_V2_API_KEY" + V2_API_ENDPOINT_V2 = "AUTOBLOCKS_V2_API_ENDPOINT" CLI_SERVER_ADDRESS = "AUTOBLOCKS_CLI_SERVER_ADDRESS" INGESTION_KEY = "AUTOBLOCKS_INGESTION_KEY" FILTERS_TEST_SUITES = "AUTOBLOCKS_FILTERS_TEST_SUITES"