The Diagnostics.InstallID setting, or a per-process ID until one is saved.
StaticInstanceAdds one entry to a session's buffer. For a session this process holds, the entry's serialized
size counts against maxBytes, and an entry that would pass it is refused. When the session's
buffered bytes pass SESSION_FLUSH_THRESHOLD_BYTES, a background save starts.
OptionalclientSeed: Partial<DiagnosticBundleData>OptionalcontextUser: UserInfoOptionalprovider: IMetadataProviderBuilds the health snapshot. The pool block appears only when the database provider measured it.
Optionalprovider: IMetadataProviderTakes a session's unsaved chunks out of memory, compressed and numbered: first the chunks an earlier save could not write (with their sequence numbers), then the current buffers.
Serialized bytes of the chunk's entries, as counted at append time.
Saves the buffers and kept chunks of every session, as contextUser or else the background save
user. A session still waiting after a failed save is skipped. Returns the chunks saved.
OptionalcontextUser: UserInfoOptionalprovider: IMetadataProviderSaves a session's buffered chunks to the database and returns how many were saved.
OptionalcontextUser: UserInfoOptionalprovider: IMetadataProviderThe Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Returns the session this process holds, even when its end time has passed.
A session that ended is no longer held; its MJ: Diagnostic Sessions row is the record.
Starts the session manager. The capture hooks (log sink, SQL observer and, unless
enableConsoleTap is false, the console tap) are installed later by SyncCaptureHooks,
only while capture is enabled and a session is held.
Optionaloptions: { enableConsoleTap?: boolean; enablePolling?: boolean }Wraps console.log, console.warn and console.error so direct console calls inside a session
are captured. The wrappers are made once and reused: removing the tap puts back a method that
still holds the wrapper, and a method that another library wrapped later keeps the wrapper,
which records nothing until the tap is installed again.
Stage 3 (Apollo Operation / Remote Operation): Evaluates Operations scope.
OptionaloperationName: stringOptionalremoteOperationKey: stringStage 2 (Post-Auth HTTP & WS): Evaluates Users and APIKeys scopes with strict CompanyID tenant isolation.
OptionaluserId: stringOptionalapiKeyId: stringOptionalcompanyId: stringStage 1 (Pre-Auth HTTP): Evaluates Instance and BrowserSession scopes. The explicit session header picks a session only when that session is active and targets this request before auth (the whole instance, or this browser session); otherwise it is ignored.
OptionalexplicitSessionId: stringOptionalbrowserSessionId: stringChecks a download token and uses it up (single use). A token already redeemed is refused, so of two requests racing on one token only one succeeds.
Saves every unsaved chunk of a session, from any source, to the database. Returns the chunks and compressed bytes saved. Saves and builds of one session run one at a time, so when this resolves, every earlier save of the session has finished.
Chunks are saved oldest first. At the first failed save, that chunk and the ones after it are put
back in memory, in order with their sequence numbers, and one line is logged; the next save retries
them first. They stay counted against the session's maxBytes.
OptionalcontextUser: UserInfoOptionalprovider: IMetadataProviderOptionaloptions: SaveSessionChunksOptionsSends an archive to an enrolled collector. See collectorClient.ts.
Sets the user (and provider) that save session buffers outside a request: when a session's buffers pass SESSION_FLUSH_THRESHOLD_BYTES and when a session ends without Stop. With no user, an ended session's buffers are dropped and the drop is logged.
Optionalprovider: IMetadataProviderSets the function called when a held Active session passes its end time and is dropped.
Installs the capture hooks while Diagnostics.Capture.Enabled is on and this process holds at
least one session, and removes them otherwise. Without the hooks, logs, SQL and console output
cost nothing extra. The expiry sweep runs while any session is held.
Checks a download token without using it up: signature, bundle ID, expiry, and that it was not redeemed yet. Use RedeemDownloadToken to use it up.
Protected StaticgetReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
OptionalclassName: string
Generic, abstract base class for any scenario where we want to use a Singleton pattern. This base class abstracts away the complexity of ensuring a truly global singleton instance across multiple code paths in a deployed application. It uses a Global Object Store to ensure that only one instance of the class exists in the application even if the class has code imported into multiple execution paths (which is not optimal, of course, but can occur in some situations).