-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
It seems when a flag is successfully evaluated with the tracing hook added, we record the flag's key (and other data) in the span:
"events": [
{
"name": "feature_flag.evaluation",
"timestamp": "2026-02-07T12:10:02.045159Z",
"attributes": {
"feature_flag.key": "test-flag",
"feature_flag.result.value": "true",
..
}
}
But if the flag evaluation errors (e.g. for a FLAG_NOT_FOUND error), the flag key isn't recorded:
"events": [
{
"name": "exception",
"timestamp": "2026-02-07T12:10:02.044985Z",
"attributes": {
"exception.type": "openfeature.exception.FlagNotFoundError",
"exception.message": "",
"exception.stacktrace": "openfeature.exception.FlagNotFoundError\n",
"exception.escaped": "False"
}
},
{
"name": "feature_flag.evaluation",
"timestamp": "2026-02-07T12:10:02.045159Z",
"attributes": {
"feature_flag.key": "test-flag",
"feature_flag.result.value": "true",
}
}
Likely because we only set the flag_key attribute during a successful flag evaluation.
It'd be very helpful to see the associated flag key for an exception in trace time. It seems all we need to do is modify this. The Spec suggests hook context must include flag key
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels