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: openfeature-provider/INTEGRATION_GUIDE.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ For language-specific installation and quick start instructions, see your provid
6
6
-[Go Provider](go/README.md)
7
7
-[Java Provider](java/README.md)
8
8
-[JavaScript Provider](js/README.md)
9
+
-[Python Provider](python/README.md)
9
10
-[Ruby Provider](ruby/README.md)
10
11
11
12
---
@@ -15,8 +16,9 @@ For language-specific installation and quick start instructions, see your provid
15
16
1.[Getting Your Credentials](#getting-your-credentials)
16
17
2.[Encryption](#encryption)
17
18
3.[Error Handling](#error-handling)
18
-
4.[Sticky Assignments](#sticky-assignments)
19
-
5.[Deferred Apply and Resolve Token Security](#deferred-apply-and-resolve-token-security)
19
+
4.[Event Tracking](#event-tracking)
20
+
5.[Sticky Assignments](#sticky-assignments)
21
+
6.[Deferred Apply and Resolve Token Security](#deferred-apply-and-resolve-token-security)
20
22
21
23
---
22
24
@@ -143,6 +145,52 @@ For debugging, use the `details` methods to get error information:
143
145
144
146
---
145
147
148
+
## Event Tracking
149
+
150
+
All local-resolve providers support the [OpenFeature tracking API](https://openfeature.dev/specification/sections/tracking), enabling you to send custom events to the [Confidence events backend](https://confidence.spotify.com/docs). Events are batched inside a shared WebAssembly engine and flushed periodically alongside flag logs — no additional configuration is required.
151
+
152
+
### How It Works
153
+
154
+
1. You call `track()` on the OpenFeature client with an event name, optional evaluation context, and optional tracking details (a numeric `value` and arbitrary custom data).
155
+
2. The event is queued inside the WASM event engine.
156
+
3. A background flush publishes batches to the Confidence events service at the same interval as flag log flushing.
157
+
4. On provider shutdown, pending events are drained (up to 100 batches).
158
+
159
+
### Delivery Guarantees
160
+
161
+
Events are delivered **at-most-once, best-effort**. Once a batch is flushed from the WASM buffer, a failed publish drops it — there is no re-queue or persistence. This matches the flag-log path. Transient failures are absorbed by transport-level retries (gRPC retry policy or fetch-layer retries), and sustained failures are surfaced via periodic warning logs rather than per-failure noise.
162
+
163
+
On shutdown, each provider drains pending events on a best-effort basis (up to 100 batches, with a timeout). Events buffered when the process is killed uncleanly (e.g. `SIGKILL`) are lost.
164
+
165
+
### Event Name Mapping
166
+
167
+
You pass bare event names (e.g. `"checkout_completed"`). The WASM engine automatically prepends the `eventDefinitions/` prefix, so the event arrives at the Confidence backend as `eventDefinitions/checkout_completed`. This matches the [event definition](https://confidence.spotify.com/docs) resource naming in Confidence — you do not need to include the prefix yourself.
168
+
169
+
### Payload Mapping
170
+
171
+
The event payload is built by merging inputs in this order:
172
+
173
+
1.**`data`** — your custom key-value fields from tracking details
174
+
2.**`value`** — the numeric value from tracking details (overwrites a same-named key from `data`)
175
+
3.**`context`** — the evaluation context (overwrites same-named keys from `data` and `value`)
176
+
177
+
`value` and `context` are reserved keys. If your custom data contains a key named `"value"` or `"context"`, it will be overwritten.
178
+
179
+
### Known Provider Differences
180
+
181
+
**Go cannot distinguish `value: 0` from an unset value.** Go's `TrackingEventDetails` stores `value` as a plain `float64` with no "is set" flag. The Go provider treats `0` as unset and omits it to avoid attaching a spurious `value: 0` to every event. Java (`Optional<Number>`), JavaScript (`number | undefined`), and Python (`Optional[float]`) can distinguish them and forward an explicit `0` correctly. If you need to record a zero-valued event from Go, put it in the custom data instead.
182
+
183
+
### Language-Specific Examples
184
+
185
+
See your provider's README for usage examples:
186
+
187
+
-[JavaScript](js/README.md#event-tracking)
188
+
-[Java](java/README.md#event-tracking)
189
+
-[Go](go/README.md#event-tracking)
190
+
-[Python](python/README.md#event-tracking)
191
+
192
+
---
193
+
146
194
## Sticky Assignments
147
195
148
196
Confidence provides **sticky** flag assignments to ensure users receive consistent variant assignments across evaluations. It can be used for two things:
@@ -225,6 +273,7 @@ The provider only needs to see the original token at apply time — anything you
Copy file name to clipboardExpand all lines: openfeature-provider/go/README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ A high-performance OpenFeature provider for [Confidence](https://confidence.spot
10
10
-**Low Latency**: No network calls during flag evaluation
11
11
-**Automatic Sync**: Periodically syncs flag configurations from Confidence
12
12
-**Exposure Logging**: Fully supported exposure logging and resolve analytics
13
+
-**[Event Tracking](#event-tracking)**: Send custom events via the OpenFeature `Track()` API
13
14
-**OpenFeature Compatible**: Works with the standard OpenFeature Go SDK
14
15
15
16
## Installation
@@ -563,6 +564,38 @@ The provider logs at different levels: `Debug` (flag resolution details), `Info`
563
564
564
565
The shutdown respects the context timeout you provide.
565
566
567
+
## Event Tracking
568
+
569
+
The provider supports the [OpenFeature tracking API](https://openfeature.dev/specification/sections/tracking) for sending custom events to the Confidence events backend. Event tracking is automatically enabled when using `NewProvider` — no configuration needed.
570
+
571
+
**📖 See the [Integration Guide: Event Tracking](../INTEGRATION_GUIDE.md#event-tracking)** for delivery guarantees, payload mapping rules, and cross-provider differences.
Events are batched internally and flushed to the Confidence events service at the same interval as flag logs (configurable via `LogPollInterval`). On shutdown, pending events are drained on a best-effort basis (up to 100 batches within a 3-second timeout).
596
+
597
+
> **Note:** Go cannot distinguish `value: 0` from an unset value. The provider treats `0` as unset and omits it. If you need to record a zero-valued event, put it in the custom data instead of `value`. See the [Integration Guide](../INTEGRATION_GUIDE.md#known-provider-differences) for details.
598
+
566
599
## Advanced: Controlling Exposure Events
567
600
568
601
By default, every flag evaluation records an exposure event (apply). Only disable this for exceptional cases where this provider must not collect exposures at all.
The provider supports the [OpenFeature tracking API](https://openfeature.dev/specification/sections/tracking) for sending custom events to the Confidence events backend. Event tracking is automatically enabled — no configuration needed.
408
+
409
+
**📖 See the [Integration Guide: Event Tracking](../INTEGRATION_GUIDE.md#event-tracking)** for delivery guarantees, payload mapping rules, and cross-provider differences.
Events are batched internally and flushed to the Confidence events service every 15 seconds. On shutdown, pending events are drained on a best-effort basis (up to 100 batches within a 5-second grace period).
431
+
404
432
## Advanced: Controlling Exposure Events
405
433
406
434
By default, every flag evaluation records an exposure event (apply). Only disable this for exceptional cases where this provider must not collect exposures at all.
Copy file name to clipboardExpand all lines: openfeature-provider/js/README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ OpenFeature provider for the Spotify Confidence resolver (local mode, powered by
6
6
7
7
- Local flag evaluation via WASM (no per-eval network calls)
8
8
- Automatic state refresh and batched flag log flushing
9
+
-[Event tracking](#event-tracking) via the OpenFeature `track()` API
9
10
- Pluggable `fetch` with retries, timeouts and routing
10
11
- Optional logging using `debug`
11
12
-**[React integration](./README-REACT.md)** for Next.js with Server Components
@@ -361,6 +362,35 @@ yarn add debug
361
362
362
363
---
363
364
365
+
## Event Tracking
366
+
367
+
The provider supports the [OpenFeature tracking API](https://openfeature.dev/specification/sections/tracking) for sending custom events to the Confidence events backend. Event tracking is automatically enabled — no configuration needed.
368
+
369
+
**📖 See the [Integration Guide: Event Tracking](../INTEGRATION_GUIDE.md#event-tracking)** for delivery guarantees, payload mapping rules, and cross-provider differences.
Events are batched internally and flushed to the Confidence events service at the same interval as flag logs (configurable via `flushInterval`). On shutdown (`onClose()`), pending events are drained on a best-effort basis (up to 100 batches).
391
+
392
+
---
393
+
364
394
## Advanced: Controlling Exposure Events
365
395
366
396
By default, every flag evaluation records an exposure event (apply). Only disable this for exceptional cases where this provider must not collect exposures at all.
The provider supports the [OpenFeature tracking API](https://openfeature.dev/specification/sections/tracking) for sending custom events to the Confidence events backend. Event tracking is automatically enabled — no configuration needed.
261
+
262
+
**📖 See the [Integration Guide: Event Tracking](../INTEGRATION_GUIDE.md#event-tracking)** for delivery guarantees, payload mapping rules, and cross-provider differences.
Events are batched internally and flushed to the Confidence events service at the same interval as flag logs (configurable via `log_poll_interval`). On shutdown, pending events are drained on a best-effort basis (up to 100 batches).
288
+
257
289
## Advanced: Controlling Exposure Events
258
290
259
291
By default, every flag evaluation records an exposure event (apply). Only disable this for exceptional cases where this provider must not collect exposures at all.
0 commit comments