Documentation ¶
Index ¶
- Constants
- Variables
- func ClampTime(input time.Time, curTime time.Time) time.Time
- func PublicMiddleware(next http.Handler) http.Handler
- type AlertCountsGroupedByRecent
- type AppendProperty
- type DeviceDetails
- type ErrorMetaData
- type FieldData
- type Location
- type NetworkResource
- type Property
- type PushPayloadChunk
- type PushPayloadMessages
- type PushPayloadResources
- type PushPayloadWebSocketEvents
- type Request
- type RequestResponsePairs
- type Resolver
- func (r *Resolver) AddLegacyMetric(ctx context.Context, sessionID int, name string, value float64) (int, error)
- func (r *Resolver) AddSessionEvents(ctx context.Context, sessionID int, events *parse.ReplayEvents) error
- func (r *Resolver) AddSessionFeedbackImpl(ctx context.Context, input *kafka_queue.AddSessionFeedbackArgs) error
- func (r *Resolver) AddSessionPropertiesImpl(ctx context.Context, sessionSecureID string, propertiesObject interface{}) error
- func (r *Resolver) AddTrackPropertiesImpl(ctx context.Context, sessionSecureID string, propertiesObject interface{}) error
- func (r *Resolver) AppendFields(ctx context.Context, fields []*model.Field, session *model.Session) error
- func (r *Resolver) AppendProperties(ctx context.Context, sessionID int, properties []AppendProperty, ...) error
- func (r *Resolver) GetErrorAppVersion(ctx context.Context, errorObj *model.ErrorObject) *string
- func (r *Resolver) GetOrCreateErrorGroup(ctx context.Context, errorObj *model.ErrorObject, matchFn func() (*int, error), ...) (*model.ErrorGroup, error)
- func (r *Resolver) GetTopErrorGroupMatch(ctx context.Context, event string, projectID int, ...) (*int, error)
- func (r *Resolver) GetTopErrorGroupMatchByEmbedding(ctx context.Context, projectID int, method model.ErrorGroupingMethod, ...) (*int, error)
- func (r *Resolver) HandleErrorAndGroup(ctx context.Context, errorObj *model.ErrorObject, ...) (*model.ErrorGroup, error)
- func (r *Resolver) HandleSessionViewable(ctx context.Context, projectID int, session *model.Session) error
- func (r *Resolver) IdentifySessionImpl(ctx context.Context, sessionSecureID string, userIdentifier string, ...) error
- func (r *Resolver) IndexSessionClickhouse(ctx context.Context, session *model.Session) error
- func (r *Resolver) InitializeSessionImpl(ctx context.Context, input *kafka_queue.InitializeSessionArgs) (*model.Session, error)
- func (r *Resolver) IsErrorIngested(ctx context.Context, projectID int, ...) bool
- func (r *Resolver) IsErrorIngestedByFilter(ctx context.Context, projectID int, ...) bool
- func (r *Resolver) IsErrorIngestedByRateLimit(ctx context.Context, projectID int, ...) bool
- func (r *Resolver) IsErrorIngestedBySample(ctx context.Context, projectID int, ...) bool
- func (r *Resolver) IsFrontendErrorIngested(ctx context.Context, projectID int, session *model.Session, ...) bool
- func (r *Resolver) IsLogIngested(ctx context.Context, logRow *clickhouse.LogRow) bool
- func (r *Resolver) IsLogIngestedByFilter(ctx context.Context, logRow *clickhouse.LogRow) bool
- func (r *Resolver) IsLogIngestedByRateLimit(ctx context.Context, logRow *clickhouse.LogRow) bool
- func (r *Resolver) IsLogIngestedBySample(ctx context.Context, logRow *clickhouse.LogRow) bool
- func (r *Resolver) IsSessionExcluded(ctx context.Context, s *model.Session, sessionHasErrors bool) (bool, *privateModel.SessionExcludedReason)
- func (r *Resolver) IsSessionExcludedByFilter(ctx context.Context, session *model.Session) bool
- func (r *Resolver) IsTraceIngested(ctx context.Context, trace *clickhouse.TraceRow) bool
- func (r *Resolver) IsTraceIngestedByFilter(ctx context.Context, trace *clickhouse.TraceRow) bool
- func (r *Resolver) IsTraceIngestedByRateLimit(ctx context.Context, trace *clickhouse.TraceRow) bool
- func (r *Resolver) IsTraceIngestedBySample(ctx context.Context, trace *clickhouse.TraceRow) bool
- func (r *Resolver) IsWithinQuota(ctx context.Context, productType model.PricingProductType, ...) (bool, float64)
- func (r *Resolver) MarkBackendSetupImpl(ctx context.Context, projectID int, setupType model.MarkBackendSetupType) error
- func (r *Resolver) MoveSessionDataToStorage(ctx context.Context, sessionId int, payloadId *int, projectId int, ...) error
- func (r *Resolver) Mutation() generated1.MutationResolver
- func (r *Resolver) ProcessBackendPayloadImpl(ctx context.Context, sessionSecureID *string, projectVerboseID *string, ...)
- func (r *Resolver) ProcessCompressedPayload(ctx context.Context, sessionSecureID string, payloadID int, data string) error
- func (r *Resolver) ProcessPayload(ctx context.Context, sessionSecureID string, ...) error
- func (r *Resolver) PushMetricsImpl(ctx context.Context, projectVerboseID *string, sessionSecureID *string, ...) error
- func (r *Resolver) Query() generated1.QueryResolver
- func (r *Resolver) SaveSessionData(ctx context.Context, projectId, sessionId, payloadId int, isBeacon bool, ...) error
- func (r *Resolver) SendSessionIdentifiedAlert(ctx context.Context, workspace *model.Workspace, project *model.Project, ...) error
- func (r *Resolver) SendSessionInitAlert(ctx context.Context, workspace *model.Workspace, project *model.Project, ...) error
- func (r *Resolver) SendSessionTrackPropertiesAlert(ctx context.Context, workspace *model.Workspace, project *model.Project, ...) error
- func (r *Resolver) SendSessionUserPropertiesAlert(ctx context.Context, workspace *model.Workspace, project *model.Project, ...) error
- func (r *Resolver) Session() generated1.SessionResolver
- func (r *Resolver) SubmitMetricsMessage(ctx context.Context, metrics []*publicModel.MetricInput) (int, error)
- func (r *Resolver) SubmitSessionEvents(ctx context.Context, sessionID int, events []*clickhouse.SessionEventRow) error
- type Response
Constants ¶
const ERROR_EVENT_MAX_LENGTH = 10000
const PAYLOAD_STAGING_COUNT_MAX = 100
const SESSION_FIELD_MAX_LENGTH = 2000
Variables ¶
var ErrQuotaExceeded = e.New(string(publicModel.PublicGraphErrorBillingQuotaExceeded))
var ErrUserFilteredError = e.New("User filtered error")
var NumberRegex = regexp.MustCompile(`^\d+$`)
var PropertyType = struct { USER Property SESSION Property TRACK Property }{ USER: "user", SESSION: "session", TRACK: "track", }
var SessionProcessDelaySeconds = 120 // a session will be processed after not receiving events for this time
var SessionProcessLockMinutes = 30 // a session marked as processing can be reprocessed after this time
Functions ¶
Types ¶
type DeviceDetails ¶
type DeviceDetails struct { IsBot bool `json:"is_bot"` OSName string `json:"os_name"` OSVersion string `json:"os_version"` BrowserName string `json:"browser_name"` BrowserVersion string `json:"browser_version"` }
func GetDeviceDetails ¶
func GetDeviceDetails(userAgentString string) (deviceDetails DeviceDetails)
type ErrorMetaData ¶
type ErrorMetaData struct { Timestamp time.Time `json:"timestamp"` ErrorID int `json:"error_id"` SessionID int `json:"session_id"` Browser string `json:"browser"` OS string `json:"os"` VisitedURL string `json:"visited_url"` Identifier string `json:"identifier"` Fingerprint int `json:"fingerprint"` }
type Location ¶
type NetworkResource ¶
type NetworkResource struct { // Deprecated, use the absolute version `StartTimeAbs` instead StartTime float64 `json:"startTime"` // Deprecated, use the absolute version `ResponseEndAbs` instead ResponseEnd float64 `json:"responseEnd"` StartTimeAbs float64 `json:"startTimeAbs"` ResponseEndAbs float64 `json:"responseEndAbs"` ConnectStartAbs float64 `json:"connectStartAbs"` ConnectEndAbs float64 `json:"connectEndAbs"` DomainLookupStartAbs float64 `json:"domainLookupStartAbs"` DomainLookupEndAbs float64 `json:"domainLookupEndAbs"` FetchStartAbs float64 `json:"fetchStartAbs"` RedirectStartAbs float64 `json:"redirectStartAbs"` RedirectEndAbs float64 `json:"redirectEndAbs"` RequestStartAbs float64 `json:"requestStartAbs"` ResponseStartAbs float64 `json:"responseStartAbs"` SecureConnectionStartAbs float64 `json:"secureConnectionStartAbs"` WorkerStartAbs float64 `json:"workerStartAbs"` DecodedBodySize float64 `json:"decodedBodySize"` TransferSize float64 `json:"transferSize"` EncodedBodySize float64 `json:"encodedBodySize"` NextHopProtocol string `json:"nextHopProtocol"` InitiatorType string `json:"initiatorType"` Name string `json:"name"` RequestResponsePairs RequestResponsePairs `json:"requestResponsePairs"` }
type PushPayloadChunk ¶
type PushPayloadChunk struct {
// contains filtered or unexported fields
}
type PushPayloadMessages ¶
type PushPayloadResources ¶
type PushPayloadResources struct {
Resources []*any `json:"resources"`
}
type PushPayloadWebSocketEvents ¶
type PushPayloadWebSocketEvents struct {
WebSocketEvents []*any `json:"webSocketEvents"`
}
type RequestResponsePairs ¶
type Resolver ¶
type Resolver struct { DB *gorm.DB Tracer trace.Tracer TracerNoResources trace.Tracer ProducerQueue kafka_queue.MessageQueue BatchedQueue kafka_queue.MessageQueue DataSyncQueue kafka_queue.MessageQueue TracesQueue kafka_queue.MessageQueue MailClient *sendgrid.Client StorageClient storage.Client EmbeddingsClient embeddings.Client Redis *redis.Client Clickhouse *clickhouse.Client RH *resthooks.Resthook Store *store.Store LambdaClient *lambda.Client SessionCache *lru.Cache[string, *model.Session] }
func (*Resolver) AddLegacyMetric ¶
func (*Resolver) AddSessionEvents ¶
func (*Resolver) AddSessionFeedbackImpl ¶
func (r *Resolver) AddSessionFeedbackImpl(ctx context.Context, input *kafka_queue.AddSessionFeedbackArgs) error
func (*Resolver) AddSessionPropertiesImpl ¶
func (*Resolver) AddTrackPropertiesImpl ¶
func (r *Resolver) AddTrackPropertiesImpl(ctx context.Context, sessionSecureID string, propertiesObject interface{}) error
Deprecated, left for backward compatibility with older client versions. Use AddSessionEvents instead
func (*Resolver) AppendFields ¶
func (*Resolver) AppendProperties ¶
func (r *Resolver) AppendProperties(ctx context.Context, sessionID int, properties []AppendProperty, propType Property) error
Change to AppendProperties(sessionId,properties,type)
func (*Resolver) GetErrorAppVersion ¶
func (*Resolver) GetOrCreateErrorGroup ¶
func (*Resolver) GetTopErrorGroupMatch ¶
func (*Resolver) GetTopErrorGroupMatchByEmbedding ¶
func (*Resolver) HandleErrorAndGroup ¶
func (r *Resolver) HandleErrorAndGroup(ctx context.Context, errorObj *model.ErrorObject, structuredStackTrace []*privateModel.ErrorTrace, projectID int, workspace *model.Workspace) (*model.ErrorGroup, error)
HandleErrorAndGroup caches the result of handleErrorAndGroup under the exact match of the error body + stacktrace. Improves performance of handleErrorAndGroup by first checking if the exact error object has been grouped before.
func (*Resolver) HandleSessionViewable ¶
func (r *Resolver) HandleSessionViewable(ctx context.Context, projectID int, session *model.Session) error
HandleSessionViewable is called after the first events to a session are written. It handles any alerts that must be sent for this session after it is able to be played.
func (*Resolver) IdentifySessionImpl ¶
func (*Resolver) IndexSessionClickhouse ¶
func (*Resolver) InitializeSessionImpl ¶
func (r *Resolver) InitializeSessionImpl(ctx context.Context, input *kafka_queue.InitializeSessionArgs) (*model.Session, error)
func (*Resolver) IsErrorIngested ¶
func (r *Resolver) IsErrorIngested(ctx context.Context, projectID int, errorObject *modelInputs.BackendErrorObjectInput) bool
func (*Resolver) IsErrorIngestedByFilter ¶
func (r *Resolver) IsErrorIngestedByFilter(ctx context.Context, projectID int, errorObject *modelInputs.BackendErrorObjectInput) bool
func (*Resolver) IsErrorIngestedByRateLimit ¶
func (r *Resolver) IsErrorIngestedByRateLimit(ctx context.Context, projectID int, errorObject *modelInputs.BackendErrorObjectInput) bool
func (*Resolver) IsErrorIngestedBySample ¶
func (r *Resolver) IsErrorIngestedBySample(ctx context.Context, projectID int, errorObject *modelInputs.BackendErrorObjectInput) bool
func (*Resolver) IsFrontendErrorIngested ¶
func (r *Resolver) IsFrontendErrorIngested(ctx context.Context, projectID int, session *model.Session, frontendError *modelInputs.ErrorObjectInput) bool
func (*Resolver) IsLogIngested ¶
func (*Resolver) IsLogIngestedByFilter ¶
func (*Resolver) IsLogIngestedByRateLimit ¶
func (*Resolver) IsLogIngestedBySample ¶
func (*Resolver) IsSessionExcluded ¶
func (r *Resolver) IsSessionExcluded(ctx context.Context, s *model.Session, sessionHasErrors bool) (bool, *privateModel.SessionExcludedReason)
func (*Resolver) IsSessionExcludedByFilter ¶
func (*Resolver) IsTraceIngested ¶
func (*Resolver) IsTraceIngestedByFilter ¶
func (*Resolver) IsTraceIngestedByRateLimit ¶
func (*Resolver) IsTraceIngestedBySample ¶
func (*Resolver) IsWithinQuota ¶
func (*Resolver) MarkBackendSetupImpl ¶
func (*Resolver) MoveSessionDataToStorage ¶
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() generated1.MutationResolver
Mutation returns generated1.MutationResolver implementation.
func (*Resolver) ProcessBackendPayloadImpl ¶
func (r *Resolver) ProcessBackendPayloadImpl(ctx context.Context, sessionSecureID *string, projectVerboseID *string, errorObjects []*publicModel.BackendErrorObjectInput)
func (*Resolver) ProcessCompressedPayload ¶
func (*Resolver) ProcessPayload ¶
func (r *Resolver) ProcessPayload(ctx context.Context, sessionSecureID string, events publicModel.ReplayEventsInput, messages string, resources string, webSocketEvents *string, errors []*publicModel.ErrorObjectInput, isBeacon bool, hasSessionUnloaded bool, highlightLogs *string, payloadId *int) error
func (*Resolver) PushMetricsImpl ¶
func (r *Resolver) PushMetricsImpl(ctx context.Context, projectVerboseID *string, sessionSecureID *string, metrics []*publicModel.MetricInput) error
func (*Resolver) Query ¶
func (r *Resolver) Query() generated1.QueryResolver
Query returns generated1.QueryResolver implementation.
func (*Resolver) SaveSessionData ¶
func (*Resolver) SendSessionIdentifiedAlert ¶
func (*Resolver) SendSessionInitAlert ¶
func (*Resolver) SendSessionTrackPropertiesAlert ¶
func (*Resolver) SendSessionUserPropertiesAlert ¶
func (*Resolver) Session ¶
func (r *Resolver) Session() generated1.SessionResolver
Session returns generated1.SessionResolver implementation.
func (*Resolver) SubmitMetricsMessage ¶
func (r *Resolver) SubmitMetricsMessage(ctx context.Context, metrics []*publicModel.MetricInput) (int, error)
func (*Resolver) SubmitSessionEvents ¶
func (r *Resolver) SubmitSessionEvents(ctx context.Context, sessionID int, events []*clickhouse.SessionEventRow) error