The SDK cannot send an exposure event:
PipelineAnalyticsProcessor.record_custom_event() sets the value field to None.
- The event schema of the SDK has no
feature_name field.
- The
Flag model has no variant key.
- The SDK sends events to
v1/analytics/batch. The JavaScript client sends events to v1/events. The two schemas are not the same.
Requirements
- Add a
get_experiment_flag(feature_name, identifier, traits=None) function to the Flagsmith client.
- The function must evaluate the flag for the given identifier.
- The function must return the flag together with its variant key.
- The function must send one
$flag_exposure event when all these conditions are true:
- The flag exists.
- The flag is enabled.
- The flag has a variant.
- When any condition is false, the function must not send the event. The function must log the cause.
- The exposure event must contain these fields:
event, feature_name, identifier, value, timestamp. The event field must contain $flag_exposure. The value field must contain the variant key.
- The processor must not send two equal exposure events in one flush interval.
- The processor must use the same endpoint and the same event schema as the JavaScript client. Confirm the correct schema with the events ingest service before you start.
References
The SDK cannot send an exposure event:
PipelineAnalyticsProcessor.record_custom_event()sets thevaluefield toNone.feature_namefield.Flagmodel has no variant key.v1/analytics/batch. The JavaScript client sends events tov1/events. The two schemas are not the same.Requirements
get_experiment_flag(feature_name, identifier, traits=None)function to theFlagsmithclient.$flag_exposureevent when all these conditions are true:event,feature_name,identifier,value,timestamp. Theeventfield must contain$flag_exposure. Thevaluefield must contain the variant key.References
api/experimentation/constants.py,api/experimentation/results_query.py{event, feature_name, identifier, value, traits, metadata, timestamp}sent to{events_api_url}/v1/events