Skip to content

Commit

Permalink
fix(sse/tracking): Use INFLUXDB_BUCKET for storing data (#3197)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi authored Dec 20, 2023
1 parent 5ef3373 commit fbd14fe
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion api/app/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,6 @@
SSE_SERVER_BASE_URL = env.str("SSE_SERVER_BASE_URL", None)
SSE_AUTHENTICATION_TOKEN = env.str("SSE_AUTHENTICATION_TOKEN", None)
AWS_SSE_LOGS_BUCKET_NAME = env.str("AWS_SSE_LOGS_BUCKET_NAME", None)
SSE_INFLUXDB_BUCKET = env.str("SSE_INFLUXDB_BUCKET", None)

RAW_ANALYTICS_DATA_RETENTION_DAYS = env.int("RAW_ANALYTICS_DATA_RETENTION_DAYS", 30)
BUCKETED_ANALYTICS_DATA_RETENTION_DAYS = env.int(
Expand Down
2 changes: 1 addition & 1 deletion api/sse/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def update_sse_usage():
agg_request_count[environment["api_key"]],
agg_last_event_generated_at[environment["api_key"]],
)
write_api.write(bucket=settings.SSE_INFLUXDB_BUCKET, record=record)
write_api.write(bucket=settings.INFLUXDB_BUCKET, record=record)


def _get_influx_point(
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unit/sse/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_track_sse_usage(
return_value=[first_access_log, second_access_log, third_access_log],
)
influxdb_bucket = "test_bucket"
settings.SSE_INFLUXDB_BUCKET = influxdb_bucket
settings.INFLUXDB_BUCKET = influxdb_bucket

mocked_influx_db_client = mocker.patch("sse.tasks.influxdb_client")
mocked_influx_point = mocker.patch("sse.tasks.Point")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@
"name": "INFLUXDB_URL",
"value": "https://eu-central-1-1.aws.cloud2.influxdata.com"
},
{
"name": "SSE_INFLUXDB_BUCKET",
"value": "sse_prod"
},
{
"name": "AWS_SSE_LOGS_BUCKET_NAME",
"value": "flagsmith-fastly-logs-production"
Expand Down Expand Up @@ -217,4 +213,4 @@
],
"cpu": "1024",
"memory": "2048"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@
"name": "INFLUXDB_URL",
"value": "https://eu-central-1-1.aws.cloud2.influxdata.com"
},
{
"name": "SSE_INFLUXDB_BUCKET",
"value": "sse_staging"
},
{
"name": "AWS_SSE_LOGS_BUCKET_NAME",
"value": "flagsmith-fastly-logs-staging"
Expand Down Expand Up @@ -205,4 +201,4 @@
],
"cpu": "1024",
"memory": "2048"
}
}

3 comments on commit fbd14fe

@vercel
Copy link

@vercel vercel bot commented on fbd14fe Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-flagsmith.vercel.app
docs.flagsmith.com
docs-git-main-flagsmith.vercel.app
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on fbd14fe Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on fbd14fe Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.