Skip to content

Commit 8dc51f3

Browse files
augment assignment logging Experiment key with allocation key (FF-848) (#27)
* handle json variant value unmarshalling correctly; add shared test files (FF-883) * augment assignment logging Experiment key with allocation key (FF-848)
1 parent 4027210 commit 8dc51f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

eppoclient/assignmentlogger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ type IAssignmentLogger interface {
88

99
type AssignmentEvent struct {
1010
Experiment string
11+
FeatureFlag string
12+
Allocation string
1113
Variation Value
1214
Subject string
1315
Timestamp string

eppoclient/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ func (ec *EppoClient) getAssignment(subjectKey string, flagKey string, subjectAt
103103

104104
assignedVariation := variationShard.Value
105105

106+
// Log assignment
106107
assignmentEvent := AssignmentEvent{
107-
Experiment: flagKey,
108+
Experiment: flagKey + "-" + rule.AllocationKey,
109+
FeatureFlag: flagKey,
110+
Allocation: rule.AllocationKey,
108111
Variation: assignedVariation,
109112
Subject: subjectKey,
110113
Timestamp: time.Now().String(),

0 commit comments

Comments
 (0)