Self-hosted: experiment events go to Flagsmith Cloud unless eventsApiUrl is set
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
研究方向
從 sdk/events.ts 和 Flagsmith 建構函式著手。issue 指出,事件 URL 在此選定,eventProcessorConfig 也在此傳入。將這項 URL 處理方式與從 apiUrl 推導 analytics URL 的方式比較。重現腳本會記錄請求目的地;當 self-hosted 環境中的事件被送往預期的 instance,或在事件將被送往 Flagsmith Cloud 時於建構期間發出警告,即為完成。
由索引模型根據 Issue 內容生成。
描述
With apiUrl pointing at a self-hosted Flagsmith and enableEvents: true, trackEvent and the exposures that getExperimentFlag records are sent to Flagsmith Cloud (https://events.api.flagsmith.com/v1/events), not to the self-hosted instance. Nothing warns: the self-hosted instance never sees the events, its experiments show no data, and each event (the identity's identifier, the event name, any value) plus the environment key leaves the network.
Where: EventProcessor takes opts.eventsApiUrl || DEFAULT_EVENTS_API_URL (sdk/events.ts; DEFAULT_EVENTS_API_URL = 'https://events.api.flagsmith.com/'), and the Flagsmith constructor passes only eventProcessorConfig through, so the default is used whatever apiUrl is. The analytics URL, by contrast, is derived from apiUrl (new URL(ANALYTICS_ENDPOINT, apiUrl)), so a self-hosted setup gets analytics right and events wrong.
Reproduction (no network: a custom fetch records the destinations): https://github.com/tharunkumardeveloper/turnout/blob/main/spikes/sdk-events-url/repro.mjs
apiUrl (self-hosted): http://127.0.0.1:55651/api/v1/
GET http://127.0.0.1:55651/api/v1/environment-document/
POST https://events.api.flagsmith.com/v1/events
Same result on 9.4.0 and 9.5.0. Found by accident while writing an example against a self-hosted 2.291.0: its experiment stayed empty while the events went to Cloud.
Suggested fix, either:
- When
apiUrlis set and isn't Flagsmith's own edge API, derive the events URL from it, as analytics already is:apiUrlwithout its trailingv1/aseventsApiUrl, so events go to{host}/api/v1/eventson the same instance (what Turnout passes today, and it works against 2.291.0); or - at least log a warning at construction when
enableEventsis true,apiUrlis not the default, andeventsApiUrlisn't set.
Option 1 matches how the analytics URL already works. Happy to open a PR for either.
- 主要語言
- TypeScript
- 星號
- 30
- 分支
- 30
- 平均合併
- 1 天 16 小時
- 30 天內合併 PR
- 11
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Flagsmith/flagsmith-nodejs-client 的其他 Issue
-
難度 2/5 1 小時以內 新手友好度 85/100
Flagsmith/flagsmith-nodejs-client#304 ·
維護者通常 2 天內回覆
-
Experimentation events are dropped when they're tracked faster than one batch round-trip, and the buffer can't be raised past Flagsmith's 2 MiB batch limit可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 4/5 3-5 天 新手友好度 42/100
Flagsmith/flagsmith-nodejs-client#330 ·
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
Flagsmith/flagsmith-nodejs-client#286 ·
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 55/100
Flagsmith/flagsmith-nodejs-client#273 · 1 則留言 ·
維護者通常 2 天內回覆
-
[sdk/local-evaluation] Duplicate identity override entries silently drop feature overrides可能已有人在做 @xolott-ark 於 203 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
Flagsmith/flagsmith-nodejs-client#267 · 5 則留言 ·
維護者通常 2 天內回覆
查看 Flagsmith/flagsmith-nodejs-client 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
earendil-works/pi#12615 ·
維護者通常 1 天內回覆
-
My Caps shows "Shared" on private Caps that were never shared可能已有人在做 @AksharP5 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
CapSoftware/Cap#4569 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 65/100
OHDSI/Data2Evidence#3749 ·
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 63/100
維護者通常 1 天內回覆
-
bug from-app needs-triage
難度 2/5 1-3 小時 新手友好度 65/100
nightly-labs/openbot#17688 ·
維護者通常 1 天內回覆