You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/appendix-d-observability.md
+31-24Lines changed: 31 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ sidebar_position: 5
8
8
# Appendix D: Observability
9
9
10
10
This document describes conventions for extracting data from the OpenFeature SDK for use in telemetry signals.
11
-
It primarily focuses on providing recommendations for mapping well-known fields in OpenFeature to [OpenTelemetry feature-flag log records](https://opentelemetry.io/docs/specs/semconv/feature-flags/feature-flags-logs/) and other semantic conventions.
11
+
It primarily focuses on providing recommendations for mapping well-known fields in OpenFeature to [OpenTelemetry feature-flag log records][otel-ff-logs] and other semantic conventions.
12
12
13
13
## Evaluations
14
14
@@ -19,42 +19,49 @@ This is particularly relevant to telemetry-related [hooks](./sections/04-hooks.m
19
19
20
20
The following describes how fields on the [evaluation details](types.md#evaluation-details) are mapped to feature flag log records:
21
21
22
-
| Log Record Attribute | Source Field or Derived Value from Evaluation Details | Notes |
|`feature_flag.evaluation.error.message`|`error message`| A human-readable error message associated with a failed evaluation. For programmatic purposes, refer to `error code`. |
|`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)|
30
-
31
-
> [!NOTE]
32
-
> 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/)).
22
+
| Log Record Attribute | Source Field or Derived Value from Evaluation Details | Requirement level | Notes |
|`feature_flag.evaluation.error.message`|`error message`|`Conditionally Required`[^1]| A human-readable error message associated with a failed evaluation. For programmatic purposes, refer to `error code`. |
> The `error.type` and `feature_flag.evaluation.reason` enumerations use a lowercase "snake_case" convention (see [OpenTelemetry feature-flag log records][otel-ff-logs]).
33
32
> OpenFeature [error codes](types.md#error-code) and [resolution reasons](./types.md#resolution-reason) should be transformed accordingly by integrations which include this data.
34
33
35
34
#### Flag Value
36
35
37
36
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
37
39
-
| Body Field | Source Field from Evaluation Details | Notes |
|`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`|`version`| A version string (format unspecified) for the flag or [flag set](./glossary.md#flag-set). |
46
+
| Log Record Attribute | Flag Metadata Key |Requirement level |Notes |
|`feature_flag.context.id`|`contextId`|`Recommended`|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. |
49
+
|`feature_flag.set.id`|`flagSetId`|`Recommended`|A logical identifier for the [flag set](./glossary.md#flag-set). |
50
+
|`feature_flag.version`|`version`|`Recommended`|A version string (format unspecified) for the flag or [flag set](./glossary.md#flag-set). |
52
51
53
-
> [!NOTE]
52
+
> [!NOTE]
54
53
> Keys in flag metadata use the "camelCase" casing convention, while the OpenTelemetry standard uses a namespaced "snake_case" convention.
55
54
56
55
### Provider Metadata
57
56
58
-
| Log Record Attribute | Provider Metadata Field | Notes |
0 commit comments