Skip to content

Commit

Permalink
fix(chalice): fixed NewRelic integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Jan 26, 2024
1 parent 0a6efe9 commit 952517f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions api/chalicelib/core/log_tool_newrelic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)

Expand Down
4 changes: 1 addition & 3 deletions api/schemas/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)


0 comments on commit 952517f

Please sign in to comment.