Skip to content

Commit e3ff639

Browse files
committed
fixup: add type, value
Signed-off-by: Todd Baert <[email protected]>
1 parent 23efc79 commit e3ff639

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

specification/appendix-d-observability.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,42 @@ This is particularly relevant to telemetry-related [hooks](./sections/04-hooks.m
1919

2020
The following describes how fields on the [evaluation details](types.md#evaluation-details) are mapped to feature flag log records:
2121

22-
| Evaluation Details Field | Log Record Attribute | Notes |
23-
| ------------------------ | --------------------------------------- | ---------------------------------------------------- |
24-
| `flag key` | `feature_flag.key` | See: [flag key](./glossary.md#flag-key) |
25-
| `error code` | `error.type` | See: [error code](./types.md#error-code) |
26-
| `variant` | `feature_flag.variant` | See: [variant](./glossary.md#variant) |
27-
| `error message` | `feature_flag.evaluation.error.message` | An error message associated with a failed evaluation |
28-
| `reason` | `feature_flag.evaluation.reason` | See: [reason](./types.md#resolution-reason) |
22+
| Log Record Attribute | Source Field or Derived Value from Evaluation Details | Notes |
23+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
24+
| `feature_flag.key` | `flag key` | See: [flag key](./glossary.md#flag-key) |
25+
| `error.type` | `error code` | See: [error code](./types.md#error-code) |
26+
| `feature_flag.variant` | `variant` | See: [variant](./glossary.md#variant) |
27+
| `feature_flag.evaluation.error.message` | `error message` | An error message associated with a failed evaluation |
28+
| `feature_flag.evaluation.reason` | `reason` | See: [reason](./types.md#resolution-reason) |
29+
| `feature_flag.evaluation.value.type` | one of `"array"`, `"boolean"`, `"byte_array"`, `"float"`, `"int"`, `"map"`, `"null"`, `"string"` or `"unknown"`, representing the type of the `evaluation details'` `value` field | See: [reason](./types.md#resolution-reason) |
2930

3031
> [!NOTE]
3132
> The `error.type` and `feature_flag.evaluation.reason` enumerations use a lowercase "snake_case" convention (see [OpenTelemetry feature-flag log records](https://opentelemetry.io/docs/specs/semconv/feature-flags/feature-flags-logs/)).
3233
> OpenFeature [error codes](types.md#error-code) and [resolution reasons](./types.md#resolution-reason) should be transformed accordingly by integrations which include this data.
3334
35+
#### Flag Value
36+
37+
The flag value is required if the `feature_flag.variant` is not set (and optional otherwise), and is defined in a the event body:
38+
39+
| Body Field | Source Field from Evaluation Details |
40+
| ---------- | ------------------------------------ |
41+
| `value` | `value` |
42+
3443
### Flag Metadata
3544

3645
The following describes how keys in [flag metadata](types.md#flag-metadata) are mapped to feature flag log records:
3746

38-
| Flag Metadata Key | Log Record Attribute | Notes |
39-
| ----------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40-
| `contextId` | `feature_flag.context.id` | The context identifier returned in the flag metadata uniquely identifies the subject of the flag evaluation. If not available, the [targeting key](./glossary.md#targeting-key) should be used. |
41-
| `flagSetId` | `feature_flag.set.id` | A logical identifier for the [flag set](./glossary.md#flag-set). |
42-
| `flagSetVersion` | `feature_flag.version` | A version string (format unspecified) for the [flag set](./glossary.md#flag-set). |
47+
| Log Record Attribute | Flag Metadata Key | Notes |
48+
| ------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
49+
| `feature_flag.context.id` | `contextId` | The context identifier returned in the flag metadata uniquely identifies the subject of the flag evaluation. If not available, the [targeting key](./glossary.md#targeting-key) should be used. |
50+
| `feature_flag.set.id` | `flagSetId` | A logical identifier for the [flag set](./glossary.md#flag-set). |
51+
| `feature_flag.version` | `flagSetVersion` | A version string (format unspecified) for the [flag set](./glossary.md#flag-set). |
4352

4453
> [!NOTE]
4554
> Keys in flag metadata use the "camelCase" casing convention, while the OpenTelemetry standard uses a namespaced "snake_case" convention.
4655
4756
### Provider Metadata
4857

49-
| Provider Metadata Field | Log Record Attribute | Notes |
50-
| ----------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------ |
51-
| `name` | `feature_flag.provider_name` | The name of the provider as defined in the `provider metadata`, available in the `hook context`. |
58+
| Log Record Attribute | Provider Metadata Field | Notes |
59+
| ---------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------ |
60+
| `feature_flag.provider_name` | `name` | The name of the provider as defined in the `provider metadata`, available in the `hook context`. |

0 commit comments

Comments
 (0)