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: docs/reference/specifications/providers.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
description: flagd provider specification
3
3
---
4
4
5
+
# flagd Providers
6
+
5
7
!!! note
6
8
7
9
This document serves as both a specification and general documentation for flagd providers.
8
10
For language-specific details, see the `README.md` for the provider in question.
9
11
10
-
# flagd Providers
11
-
12
12
flagd providers are as essential as the flagd daemon itself, acting as the "bridge" between the OpenFeature SDK and flagd.
13
13
In fact, flagd providers may be the most crucial part of the flagd framework, as they can be used without an active flagd instance.
14
14
This document outlines their behavior and configuration.
@@ -73,7 +73,7 @@ The lifecycle is summarized below:
73
73
- if stream connection fails or exceeds the time specified by `deadline`, abort initialization (SDK will emit `PROVIDER_ERROR`), and attempt to [reconnect](#stream-reconnection)
74
74
- while connected:
75
75
- flags are resolved according to resolver mode; either by calling evaluation RPCs, or by evaluating the stored `flag set` rules
76
-
- for RPC providers, flags resolved with `reason=STATIC` are [cached](#caching)
76
+
- for RPC providers, flags resolved with `reason=STATIC` are [cached](#flag-evaluation-caching)
77
77
- if flags change the associated stream (event or sync) indicates flags have changed, flush cache, or update `flag set` rules respectively and emit `PROVIDER_CONFIGURATION_CHANGED`
78
78
- if stream disconnects:
79
79
-[reconnect](#stream-reconnection) with backoff
@@ -82,7 +82,7 @@ The lifecycle is summarized below:
82
82
- if reconnect attempt <= `retryGraceAttempts`
83
83
- emit `PROVIDER_STALE`
84
84
- RPC mode resolves `STALE` from cache where possible
85
-
- in-process mode resolves `STALE` from stored `flag set` rules
85
+
- in-process mode resolves `STALE` from stored `flag set` rules
86
86
- on stream reconnection:
87
87
- emit `PROVIDER_READY` and `PROVIDER_CONFIGURATION_CHANGED`
88
88
- in-process providers store the latest `flag set` rules
@@ -126,7 +126,7 @@ stateDiagram-v2
126
126
%% ** In-Process providers only
127
127
```
128
128
129
-
```
129
+
```pseudo
130
130
* RPC providers only
131
131
** In-Process providers only
132
132
```
@@ -143,7 +143,7 @@ The provider attempts to reconnect indefinitely, with a maximum interval of `ret
143
143
144
144
RPC providers use the [evaluation protocol](./protos.md#flagdevaluationv1evaluationproto) to connect to flagd, initiate the [event stream](./protos.md#eventstreamresponse), listen for changes in the flag definitions, and evaluate flags remotely by calling flagd.
145
145
RPC providers are relatively simple to implement since they essentially call a remote flagd instance with relevant parameters, and then flagd responds with the resolved flag value.
146
-
Of course, this means there's latency associated with RPC providers, though this is mitigated somewhat by [caching](#flag-evaluation-caching).
146
+
Of course, this means there's latency associated with RPC providers, though this is mitigated somewhat by [caching](#flag-evaluation-caching).
147
147
148
148
### Flag Evaluation Caching
149
149
@@ -189,6 +189,7 @@ Client side flagd providers (used in mobile and front-end web applications) have
189
189
These flagd providers only support the RPC resolver mode (so that `flag set` rules, which might contain sensitive information, are never sent to the client).
190
190
Instead, these do bulk evaluations of all flags in the `flag set`, and cache the results until they are invalidated.
191
191
Bulk evaluations take place when:
192
+
192
193
- the provider is initialized
193
194
- the context is changed
194
195
- a change in the definition notifies the provider it should re-evaluate the flags
@@ -203,7 +204,7 @@ This pattern is consistent with OpenFeature's [static context paradigm](https://
203
204
204
205
flagd supports the OFREP protocol, meaning client-side OFREP providers can also be used for client-side use-cases.
205
206
206
-
### Provider Metadata
207
+
### RPC Mode Provider Metadata
207
208
208
209
The provider metadata includes properties returned from the [provider_ready event payload](./protos.md#eventstreamresponse) data.
209
210
@@ -245,6 +246,6 @@ In-process flagd providers also inject any properties returned by the [sync-meta
245
246
This allows for static properties defined in flagd to be added to in-process evaluations.
246
247
If only a subset of the sync-metadata response is desired to be injected into the evaluation context, you can use the define a mapping function with the `contextEnricher` option.
247
248
248
-
### Provider Metadata
249
+
### In-Process Mode Provider Metadata
249
250
250
-
The provider metadata includes the top-level metadata property in the [flag definition](../flag-definitions.md).
251
+
The provider metadata includes the top-level metadata property in the [flag definition](../flag-definitions.md).
0 commit comments