Skip to content

Feat/231 sdk feature usage analytics collector#344

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
adefemiesther1-debug:feat/231-sdk-feature-usage-analytics-collector
Jun 26, 2026
Merged

Feat/231 sdk feature usage analytics collector#344
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
adefemiesther1-debug:feat/231-sdk-feature-usage-analytics-collector

Conversation

@adefemiesther1-debug

Copy link
Copy Markdown
Contributor

Description
Closes #231
Overview
This PR introduces an opt-in, privacy-preserving client interface analytics telemetry framework inside src/usageAnalytics.ts. This subsystem provides product development insight by counting which SDK interface methods are actively leveraged by integrating platforms. It functions completely independently of network-level RPC tracing, using memory-efficient runtime proxies to capture call statistics with zero argument exposure.

Changes
Branch Infrastructure: Created and isolated tracking workspace within feat/231-sdk-feature-usage-analytics-collector.

New Analytics Engine (src/usageAnalytics.ts):

Implemented a Proxy-driven decorator pattern that wraps standard client modules to catch functional access logs seamlessly.

Added configuration validation layers enforcing a strict disabled-by-default execution boundary (config.usageAnalytics = true).

Structured an internal integer-only ledger map tracking method names while explicitly avoiding parameter interception or PII storage.

Batching Lifecycle Control:

Developed an asynchronous flush() dispatcher that unloads local maps over a configurable POST destination before clearing memory buffers.

Configured automated heartbeat loops to regularly purge accumulated data points on user-defined time frequencies.

Automated Unit Testing Suite Added (src/tests/usageAnalytics.test.ts):

Verified opt-in compliance, counting precision, multi-method aggregation safety, and immediate state evacuation following flush completion.

Performance & Privacy Guarantees
Privacy Isolation: The proxy layer possesses no reference hooks tracking function arguments. It records the string literal method name exclusively, protecting user data at the edge.

Low-Overhead Traps: Leverages standard object reference interceptors that evaluate instantly in-memory, avoiding blocking bottlenecks or execution lag on hot client transaction paths.

Verification & Testing Checklist
[x] Type Safety Verification: Confirmed full workspace configurations compile smoothly with zero TypeScript compilation faults.

[x] Linter Compliance: Cleared code styling checks via npm run lint to fulfill repository formatting criteria.

[x] Conventional Commit Integrity: Grouped file updates into an atomic conventional commit framework and pushed directly to origin.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@adefemiesther1-debug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99 Kingsman-99 merged commit ae7c872 into Stellar-split:main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SDK feature usage analytics collector

2 participants