Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Flag evaluation event #1440

Merged
merged 47 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
64cc6e1
Feature Flag: feature_flag.evaluation event
dyladan Sep 30, 2024
9d70d52
Remove ff events.yaml for now
dyladan Sep 30, 2024
17661ad
Deprecate
dyladan Sep 30, 2024
5a1315f
Fix lint errors
dyladan Sep 30, 2024
778a506
Add changelog entry
dyladan Sep 30, 2024
955784e
Merge branch 'main' into ff-evaluation-event
dyladan Sep 30, 2024
5353b33
Merge remote-tracking branch 'origin/main' into ff-evaluation-event
dyladan Oct 14, 2024
1b2d939
Update ff version to be clear a hash is not a specific recommendation
dyladan Oct 14, 2024
49bbdff
Merge remote-tracking branch 'origin/main' into ff-evaluation-event
dyladan Oct 28, 2024
ab16aba
Rename environment to flag set
dyladan Oct 28, 2024
4ffa81c
Describe feature_flag.key as lookup key
dyladan Oct 28, 2024
97b68d8
Update requirement level for variant and value
dyladan Oct 28, 2024
4e70d70
Avoid word repetition
dyladan Oct 28, 2024
78938e0
Clarify permissiveness of provider id
dyladan Oct 28, 2024
5e4bf75
Merge branch 'main' into ff-evaluation-event
dyladan Nov 4, 2024
e9e209e
Rename flag_set to just set
dyladan Nov 4, 2024
9e68f15
Use system terminology to match db and gen_ai
dyladan Nov 4, 2024
25f4783
Expand brief for flag evaluation event
dyladan Nov 4, 2024
51b7e45
Move feature_flag.value to body field
dyladan Nov 5, 2024
f12c1cf
Add evaluation reason
dyladan Nov 5, 2024
7555d86
Generate tables
dyladan Nov 5, 2024
9ef0ba1
Add feature flag error code
dyladan Nov 5, 2024
ebab494
Add feature flag evaluation log motivation
dyladan Nov 5, 2024
fcca5a6
Fix: provider.id renamed to system
dyladan Nov 5, 2024
5513c81
Add flag evaluation error message
dyladan Nov 5, 2024
27aa56a
Misspell
dyladan Nov 6, 2024
5ae514a
Apply suggestions from code review and remove broken links
dyladan Nov 6, 2024
2e7ca66
Merge branch 'main' into ff-evaluation-event
dyladan Nov 6, 2024
118ce57
Fix issue number
dyladan Nov 6, 2024
4d56d44
Merge remote-tracking branch 'origin/main' into ff-evaluation-event
dyladan Nov 11, 2024
37d9b8e
Apply suggestions from code review
dyladan Nov 11, 2024
31eb9c6
Use generic error.type
dyladan Nov 11, 2024
c08b2e2
Remove merge marker
dyladan Nov 11, 2024
c6a6587
Fix reference to error.type
dyladan Nov 11, 2024
43cdfd4
Fix event ID
dyladan Nov 12, 2024
091811e
Use ff specific examples for error type
dyladan Nov 12, 2024
d710653
Fix reference to error type
dyladan Nov 12, 2024
2c5b57f
Move general to end of table
dyladan Nov 12, 2024
fa6071e
Merge remote-tracking branch 'origin/main' into ff-evaluation-event
dyladan Nov 12, 2024
0ef7ef2
Trim trailing whitespace
dyladan Nov 12, 2024
006ecae
Merge branch 'main' into ff-evaluation-event
lmolkova Nov 13, 2024
19fc3da
Merge remote-tracking branch 'origin/main' into ff-evaluation-event
dyladan Nov 13, 2024
6de17ec
Rename feature_flag.provider_name to feature_flag.system in schema
dyladan Nov 13, 2024
a1b54b6
Apply suggestions from code review
dyladan Nov 13, 2024
4548c48
Yaml lint
dyladan Nov 14, 2024
753c69b
Trailing space
dyladan Nov 14, 2024
0ee66e0
Merge branch 'main' into ff-evaluation-event
jsuereth Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add flag evaluation error message
  • Loading branch information
dyladan committed Nov 5, 2024
commit 5513c8120bd187388ade2b0039830343bde61fdd
1 change: 1 addition & 0 deletions docs/attributes-registry/feature-flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This document defines attributes for Feature Flags.
|---|---|---|---|---|
| <a id="feature-flag-context-id" href="#feature-flag-context-id">`feature_flag.context.id`</a> | string | The unique identifier for the flag evaluation context. For example, the targeting key. | `5157782b-2203-4c80-a857-dbbd5e7761db` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="feature-flag-error-code" href="#feature-flag-error-code">`feature_flag.error.code`</a> | string | An error code which shows why a flag evaluation failed | `provider_not_ready`; `targeting_key_missing`; `provider_fatal`; `general` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="feature-flag-error-message" href="#feature-flag-error-message">`feature_flag.error.message`</a> | string | A message explaining why an error occurred during flag evaluation. | `Flag `header-color` expected type `string` but found type `number`` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="feature-flag-key" href="#feature-flag-key">`feature_flag.key`</a> | string | The lookup key of the feature flag. | `logo-color` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="feature-flag-reason" href="#feature-flag-reason">`feature_flag.reason`</a> | string | The reason code which shows how a feature flag value was determined. | `static`; `targeting_match`; `error`; `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="feature-flag-set-id" href="#feature-flag-set-id">`feature_flag.set.id`</a> | string | The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) which the feature flag belongs to in a flag management system. | `proj-1`; `ab98sgs`; `service1/dev` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
13 changes: 9 additions & 4 deletions docs/feature-flags/feature-flags-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,25 @@ This semantic convention defines the attributes used to represent a feature flag
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`feature_flag.key`](/docs/attributes-registry/feature-flag.md) | string | The lookup key of the feature flag. | `logo-color` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.error.code`](/docs/attributes-registry/feature-flag.md) | string | An error code which shows why a flag evaluation failed | `provider_not_ready`; `targeting_key_missing`; `provider_fatal`; `general` | `Conditionally Required` If an error occurred during flag evaluation. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.variant`](/docs/attributes-registry/feature-flag.md) | string | A semantic identifier for an evaluated flag value. [1] | `red`; `true`; `on` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.error.code`](/docs/attributes-registry/feature-flag.md) | string | An error code which shows why a flag evaluation failed | `provider_not_ready`; `targeting_key_missing`; `provider_fatal`; `general` | `Conditionally Required` [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.error.message`](/docs/attributes-registry/feature-flag.md) | string | A message explaining why an error occurred during flag evaluation. | `Flag `header-color` expected type `string` but found type `number`` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.variant`](/docs/attributes-registry/feature-flag.md) | string | A semantic identifier for an evaluated flag value. [3] | `red`; `true`; `on` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.context.id`](/docs/attributes-registry/feature-flag.md) | string | The unique identifier for the flag evaluation context. For example, the targeting key. | `5157782b-2203-4c80-a857-dbbd5e7761db` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.reason`](/docs/attributes-registry/feature-flag.md) | string | The reason code which shows how a feature flag value was determined. | `static`; `targeting_match`; `error`; `default` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.set.id`](/docs/attributes-registry/feature-flag.md) | string | The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) which the feature flag belongs to in a flag management system. | `proj-1`; `ab98sgs`; `service1/dev` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.system`](/docs/attributes-registry/feature-flag.md) | string | Identifies the feature flag provider. | `Flag Manager` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`feature_flag.version`](/docs/attributes-registry/feature-flag.md) | string | The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset. | `1`; `01ABCDEF` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** A semantic identifier, commonly referred to as a variant, provides a means
**[1]:** Required if an error occured during flag evaluation and `feature_flag.error.message` is not set, recommended otherwise.

**[2]:** Required if an error occured during flag evaluation and `feature_flag.error.code` is not set, recommended otherwise.

**[3]:** A semantic identifier, commonly referred to as a variant, provides a means
for referring to a value without including the value itself. This can
provide additional context for understanding the meaning behind a value.
For example, the variant `red` maybe be used for the value `#c05543`.

**[2]:** If feature flag provider supplies a variant or equivalent concept.
**[4]:** If feature flag provider supplies a variant or equivalent concept.

`feature_flag.error.code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Expand Down
5 changes: 4 additions & 1 deletion model/feature-flag/logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ groups:
requirement_level: recommended
- ref: feature_flag.error.code
requirement_level:
conditionally_required: If an error occurred during flag evaluation.
conditionally_required: Required if an error occured during flag evaluation and `feature_flag.error.message` is not set, recommended otherwise.
- ref: feature_flag.error.message
requirement_level:
conditionally_required: Required if an error occured during flag evaluation and `feature_flag.error.code` is not set, recommended otherwise.
body:
id: feature_flag.evaluation
type: map
Expand Down
5 changes: 5 additions & 0 deletions model/feature-flag/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@ groups:
examples: ["provider_not_ready", "targeting_key_missing", "provider_fatal", "general"]
brief: >
An error code which shows why a flag evaluation failed
- id: feature_flag.error.message
type: string
stability: experimental
examples: ["Flag `header-color` expected type `string` but found type `number`"]
brief: A message explaining why an error occurred during flag evaluation.
Loading