Skip to content

infra: Add a new specific task definition for the admin API to enable sentry tracing for admin requests#6496

Merged
matthewelwell merged 5 commits intomainfrom
infra/sentry-sample-all-admin-requests
Feb 12, 2026
Merged

infra: Add a new specific task definition for the admin API to enable sentry tracing for admin requests#6496
matthewelwell merged 5 commits intomainfrom
infra/sentry-sample-all-admin-requests

Conversation

@matthewelwell
Copy link
Contributor

Changes

The purpose of this PR is to enable sentry tracing on all requests to the newly separated Admin API service.

In order to do so, I have created a new task definition instead of reusing the one for the SDK API.

How did you test this code?

TODO

@matthewelwell matthewelwell requested review from a team as code owners January 8, 2026 12:15
@matthewelwell matthewelwell requested review from gagantrivedi and removed request for a team January 8, 2026 12:15
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 12, 2026 4:14pm
flagsmith-frontend-preview Ready Ready Preview, Comment Feb 12, 2026 4:14pm
flagsmith-frontend-staging Ready Ready Preview, Comment Feb 12, 2026 4:14pm

Request Review

@matthewelwell matthewelwell marked this pull request as draft January 8, 2026 12:15
@matthewelwell matthewelwell removed request for a team and gagantrivedi January 8, 2026 12:15
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6496 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-6496 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-6496 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-6496 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6496 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6496 Finished ✅ Results

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (b3d5a33) to head (aaaaad7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6496   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files        1311     1311           
  Lines       48474    48474           
=======================================
  Hits        47617    47617           
  Misses        857      857           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

khvn26
khvn26 previously approved these changes Feb 12, 2026
@matthewelwell matthewelwell changed the title infra: add a new specific task definition for the admin API to enable sentry tracing for admin requests infra: Add a new specific task definition for the admin API to enable sentry tracing for admin requests Feb 12, 2026
@matthewelwell matthewelwell marked this pull request as ready for review February 12, 2026 16:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

with:
cluster: ${{ inputs.aws_ecs_cluster_name }}
service: ${{ inputs.aws_ecs_sdk_service_name }}
task-definition: ${{ steps.task-def-admin-api.outputs.task-definition }}
Copy link

Choose a reason for hiding this comment

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

Admin and SDK task definitions deployed to wrong services

High Severity

The task definitions are swapped between services. The step "Deploy Amazon ECS SDK API task definition" deploys task-def-sdk-api to aws_ecs_service_name (the admin/main service), while "Deploy Amazon ECS SDK service" deploys task-def-admin-api to aws_ecs_sdk_service_name (the SDK service). The verification step at line 167 confirms aws_ecs_service_name is the admin service by naming its output RUNNING_ADMIN_API_TASK_DEF. This means the admin service gets the SDK config and the SDK service gets the admin config.

Additional Locations (1)

Fix in Cursor Fix in Web

task-definition: ${{ steps.task-def-sdk-api.outputs.task-definition }}

- name: Deploy Amazon ECS SDK service with same task definition
run: |
Copy link

Choose a reason for hiding this comment

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

Removed step ID breaks deployment verification step

High Severity

The old step id: deploy-api-task-def was removed when renaming the deploy step, but line 166 still references steps.deploy-api-task-def.outputs.task-definition-arn. This will resolve to an empty string, causing EXPECTED_TASK_DEF to be empty and the "Verify correct version is running" check to always fail, blocking every deployment.

Fix in Cursor Fix in Web

{
"name": "DASHBOARD_ENDPOINTS_SENTRY_TRACE_SAMPLE_RATE",
"value": "0.002"
"value": "0"
Copy link

Choose a reason for hiding this comment

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

Dashboard sentry trace rate set to zero despite discussion

Medium Severity

DASHBOARD_ENDPOINTS_SENTRY_TRACE_SAMPLE_RATE was changed from "0.002" to "0", completely disabling dashboard endpoint sentry tracing on the SDK API. The PR discussion explicitly concluded this value should be left as it was, but it remains set to "0" in the current diff.

Fix in Cursor Fix in Web

"containerPort": 8000,
"hostPort": 8000,
"protocol": "tcp"
}
Copy link

Choose a reason for hiding this comment

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

New task definitions missing Prometheus port 9100

Medium Severity

Both new task definition files only expose port 8000 but set PROMETHEUS_ENABLED to "True". Every other task definition in the codebase (production SDK API, staging admin API, both task processors) exposes port 9100 alongside 8000 for Prometheus metrics scraping. Without port 9100, Prometheus won't be able to collect metrics from the production admin API or staging SDK API despite the feature being enabled.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants