Skip to content

Commit f94ebee

Browse files
authored
docs: clarify that bucketing keys are strings (#1619)
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
1 parent a5d43bc commit f94ebee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/reference/custom-operations/fractional-operation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ The `defaultVariant` is `red`, but it contains a [targeting rule](../flag-defini
6464
In this case, `25%` of the evaluations will receive `red`, `25%` will receive `blue`, and so on.
6565

6666
Assignment is deterministic (sticky) based on the expression supplied as the first parameter (`{ "cat": [{ "var": "$flagd.flagKey" }, { "var": "email" }]}`, in this case).
67-
The value retrieved by this expression is referred to as the "bucketing value".
67+
The value retrieved by this expression is referred to as the "bucketing value" and must be a string.
68+
Other primitive types can be used by casting the value using `"cat"` operator.
69+
For example, a less deterministic distribution can be achieved using `{ "cat": [{ "var": "$flagd.timestamp" }]}`.
6870
The bucketing value expression can be omitted, in which case a concatenation of the `targetingKey` and the `flagKey` will be used.
6971

7072
The `fractional` operation is a custom JsonLogic operation which deterministically selects a variant based on

docs/schema/v0/targeting.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@
476476
"$comment": "there seems to be a bug here, where ajv gives a warning (not an error) because maxItems doesn't equal the number of entries in items, though this is valid in this case",
477477
"items": [
478478
{
479-
"description": "Bucketing value used in pseudorandom assignment; should be unique and stable for each subject of flag evaluation. Defaults to a concatenation of the flagKey and targetingKey.",
479+
"description": "Bucketing value used in pseudorandom assignment; should be a string that is unique and stable for each subject of flag evaluation. Defaults to a concatenation of the flagKey and targetingKey.",
480480
"$ref": "#/definitions/anyRule"
481481
},
482482
{

0 commit comments

Comments
 (0)