diff --git a/api/chalicelib/core/log_tool_newrelic.py b/api/chalicelib/core/log_tool_newrelic.py index 1eb23c6aae..c25e2d15dc 100644 --- a/api/chalicelib/core/log_tool_newrelic.py +++ b/api/chalicelib/core/log_tool_newrelic.py @@ -14,8 +14,8 @@ def get(project_id): def update(tenant_id, project_id, changes): options = {} - if "region" in changes and len(changes["region"]) == 0: - options["region"] = "US" + if "region" in changes: + options["region"] = changes["region"] if "applicationId" in changes: options["applicationId"] = changes["applicationId"] if "xQueryKey" in changes: @@ -25,8 +25,7 @@ def update(tenant_id, project_id, changes): def add(tenant_id, project_id, application_id, x_query_key, region): - if region is None or len(region) == 0: - region = "US" + # region=False => US; region=True => EU options = {"applicationId": application_id, "xQueryKey": x_query_key, "region": region} return log_tools.add(project_id=project_id, integration=IN_TY, options=options) diff --git a/api/schemas/schemas.py b/api/schemas/schemas.py index 00a693fb70..25d315c7b2 100644 --- a/api/schemas/schemas.py +++ b/api/schemas/schemas.py @@ -295,7 +295,7 @@ class IntegartionStackdriverSchema(IntegrationBase): class IntegrationNewrelicSchema(IntegrationBase): application_id: str = Field(...) x_query_key: str = Field(...) - region: str = Field(...) + region: bool = Field(default=False) class IntegrationRollbarSchema(IntegrationBase): @@ -1587,5 +1587,3 @@ class TagCreate(TagUpdate): selector: str = Field(..., min_length=1, max_length=255) ignoreClickRage: bool = Field(default=False) ignoreDeadClick: bool = Field(default=False) - -