Record Class CapturedClientError
java.lang.Object
java.lang.Record
com.vaadin.observability.micrometer.insights.CapturedClientError
- Record Components:
timestamp- when the server received the report. The error happenedbufferedMsearlier on the browser's clockroute- the route template of the view the browser was on, resolved from the path the browser reportedkind-uncaughtfor a throw that reachedwindow.onerror,promisefor an unhandled rejection — the same values that tag the countermessage- the error message, truncated;nullwhen it was not collected (seedetailsIncluded)source- where the browser said it came from, asscript-url:line;nullwhen the browser named no locationframe- the location named by the first frame of the error's stack, asscript-url:line:col— the browser-side equivalent ofCapturedInteraction.applicationFrame(). The location only, without the function name that stood in front of it: seeStackFrames.nullwhen the stack held no frame that named a locationfunction- the name of the function that frame was in, exactly as the browser wrote it and truncated;nullwhen the frame named none, or whenever detail was not collected (seedetailsIncluded). Gated with the message rather than published beside the location, because a page can set a function's name to any string it likesbufferedMs- how long the report waited for the browser to reach the server again, measured on the browser's own clock. Offline time only, not the wait for the next flush, so zero for an ordinary report however long it sat in the buffer. Greater than zero means this report could not be delivered when it was raised — which is not the same as the error happening during an outage: a report taken while the browser was connected still accrues an outage that begins before the next flush. Read it as evidence that something went wrong the server could not be told about at the time, not as a measurement of when it went wrongdetailsIncluded- whether potentially sensitive detail was collected: the raw session id, the error message and the function name. Recorded per error so a report can say that a field was withheld rather than absentsessionId- the Vaadin session id when detail was collected, otherwise a short one-way hash of ituiId- UI id within the session, i.e. which browser tab reported it
public record CapturedClientError(Instant timestamp, String route, String kind, String message, String source, String frame, String function, long bufferedMs, boolean detailsIncluded, String sessionId, int uiId)
extends Record
One error raised in a browser, with the detail
vaadin.client.errors
cannot carry.
The counter says how many browser errors happened and whether each was an
uncaught throw or an unhandled rejection. That is all it can say: a message,
a script URL and a stack frame are free-form text, and putting them on meter
tags would make one time series per distinct message. They are retained here
instead, the same way a failed server interaction is retained as a
CapturedInteraction, so a report can name the error rather than count
it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebufferedMsrecord component.booleanReturns the value of thedetailsIncludedrecord component.final booleanIndicates whether some other object is "equal to" this one.frame()Returns the value of theframerecord component.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.message()Returns the value of themessagerecord component.route()Returns the value of therouterecord component.Returns the value of thesessionIdrecord component.source()Returns the value of thesourcerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.intuiId()Returns the value of theuiIdrecord component.
-
Constructor Details
-
CapturedClientError
public CapturedClientError(Instant timestamp, String route, String kind, String message, String source, String frame, String function, long bufferedMs, boolean detailsIncluded, String sessionId, int uiId) Creates an instance of aCapturedClientErrorrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentroute- the value for therouterecord componentkind- the value for thekindrecord componentmessage- the value for themessagerecord componentsource- the value for thesourcerecord componentframe- the value for theframerecord componentfunction- the value for thefunctionrecord componentbufferedMs- the value for thebufferedMsrecord componentdetailsIncluded- the value for thedetailsIncludedrecord componentsessionId- the value for thesessionIdrecord componentuiId- the value for theuiIdrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
route
Returns the value of therouterecord component.- Returns:
- the value of the
routerecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
frame
Returns the value of theframerecord component.- Returns:
- the value of the
framerecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-
bufferedMs
public long bufferedMs()Returns the value of thebufferedMsrecord component.- Returns:
- the value of the
bufferedMsrecord component
-
detailsIncluded
public boolean detailsIncluded()Returns the value of thedetailsIncludedrecord component.- Returns:
- the value of the
detailsIncludedrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
uiId
public int uiId()Returns the value of theuiIdrecord component.- Returns:
- the value of the
uiIdrecord component
-