feat: add diagnostic logging for setter/selectPlacements timing - #130
Closed
alexs-mparticle wants to merge 2 commits into
Closed
feat: add diagnostic logging for setter/selectPlacements timing#130alexs-mparticle wants to merge 2 commits into
alexs-mparticle wants to merge 2 commits into
Conversation
Logs attribute/identity setter calls (setUserAttribute, removeUserAttribute, onUserIdentified, onLoginComplete, onLogoutComplete, onModifyComplete) and selectPlacements dispatches independently via LoggingService, so the delta between when attributes get set and when a placement call goes out can be computed downstream from the logged timestamps and page URL. Only attribute keys are logged, never values, to avoid shipping customer PII into the logging pipeline. Diagnostic logs use their own rate-limit bucket (still shipped at severity INFO) so they can't starve the operational INFO budget shared with page-view/quota logging.
Reverts ReportingTransport.send() to its original signature and instead gives LoggingService a dedicated ReportingTransport (its own RateLimiter, reusing the existing optional constructor param) for logDiagnostic(), so the rate-limit isolation lives entirely where it's needed instead of on the shared send() method used by ErrorReportingService too.
2 tasks
Collaborator
Author
|
Superseded — the rokt kit now lives in the mparticle-web-sdk monorepo under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setUserAttribute,removeUserAttribute,onUserIdentified,onLoginComplete,onLogoutComplete,onModifyComplete) viaLoggingService.logDiagnostic()with the affected attribute keys (never values).selectPlacementsdispatch with the full set of placement attribute keys.ReportingTransportalready attaches to every log request.logDiagnostic()ships atseverity: "INFO"on the wire (same aslog()) but under its own isolated rate-limit bucket, so a burst of setter/placement diagnostics can't starve the operational INFO budget shared with page-view/quota logging.Example log messages
Test plan
npm run lintpassesnpm run buildpasses (pre-existingIUserIdentities/getMPIDtype errors reproduce identically onmain— unrelated to this change)npm run test— 340/340 passing, including new unit tests fordiagnosticTiming.tsand integration coverage for every setter/identity call site and theselectPlacementsdispatch