Skip to content

feat(experimentation): receive SDK events in Django for the Flagsmith database warehouse - #8864

Merged
Zaimwa9 merged 48 commits into
mainfrom
feat/experimentation-sdk-events-endpoint
Nov 4, 2026
Merged

Zaimwa9 merged 48 commits into
mainfrom
feat/experimentation-sdk-events-endpoint

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Follows #8857.

Environments using the Flagsmith database warehouse receive SDK events in Django, with no ingestion server. POST /api/v1/events accepts the ingestion server's payload and limits (X-Environment-Key, per-event validation, 202/400 with accepted/rejected, 2 MiB body limit with 413), so SDKs only change their events base URL.

  • Events are validated one by one with SDKExperimentationEventSerializer; valid ones are stored in SDKExperimentationEvent with one bulk_create.
  • Environments without a Flagsmith database connection get 404.
  • Adds the flagsmith_experimentation_sdk_events_total counter and an experimentation.sdk_events.rejected log event (counts and field names only).

Contract deviations: DRF-style error messages; 403 for a missing or unknown key; 500 on database errors; SDK versions not yet tracked in app_analytics are stored as unknown; no gzip request decompression; chunked bodies without Content-Length read as empty. The endpoint is unthrottled, like the existing SDK endpoints and the ingestion server.

How did you test this code?

Unit tests for the serializer and the endpoint, plus the Python SDK against a local self-hosted instance on PostgreSQL 16: events stored, and event names, stats and experiment results matched what was sent.

Zaimwa9 and others added 29 commits October 26, 2026 14:56
…se-deployment

# Conflicts:
#	api/experimentation/warehouses/constants.py
#	api/experimentation/warehouses/postgres.py
#	api/tests/unit/experimentation/conftest.py
#	api/tests/unit/experimentation/test_views.py
#	api/tests/unit/experimentation/warehouses/test_postgres.py
… and skip delivery status for the flagsmith database
…nt' into feat/postgres-warehouse-deployment

# Conflicts:
#	openapi.yaml
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 3, 2026 3:02pm UTC
flagsmith-frontend-preview Ignored Ignored Preview Nov 3, 2026 3:02pm UTC
flagsmith-frontend-staging Ignored Ignored Preview Nov 3, 2026 3:02pm UTC

Request Review

…non-finite traits and cap generated connection names
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Nov 3, 2026
@github-actions github-actions Bot added the docs Documentation updates label Nov 3, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Nov 3, 2026
… the batch with a serializer and move mappers and limits
@github-actions github-actions Bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Nov 3, 2026
@github-actions github-actions Bot added the docs Documentation updates label Nov 3, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Nov 3, 2026
@Zaimwa9
Zaimwa9 requested a review from gagantrivedi November 3, 2026 15:31
@Zaimwa9
Zaimwa9 merged commit 31b9d56 into main Nov 4, 2026
35 checks passed
@Zaimwa9
Zaimwa9 deleted the feat/experimentation-sdk-events-endpoint branch November 4, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants