Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorMatchesQuery(errorObject *model2.BackendErrorObjectInput, filters listener.Filters) bool
- func GetEventsQueryImpl(params modelInputs.QueryInput, projectId int, selectColumns string, ...) (string, []interface{}, error)
- func GetPostgresConnectionString() string
- func GetSessionsQueryImpl(admin *model.Admin, params modelInputs.QueryInput, projectId int, ...) (string, []interface{}, bool, error)
- func GetSessionsQueryImplDeprecated(admin *model.Admin, query modelInputs.ClickhouseQuery, projectId int, ...) (string, []interface{}, bool, error)
- func KeyValuesAggregated(ctx context.Context, client *Client, tableName string, projectID int, ...) ([]string, error)
- func KeysAggregated(ctx context.Context, client *Client, tableName string, projectID int, ...) ([]*modelInputs.QueryKey, error)
- func LogMatchesQuery(logRow *LogRow, filters listener.Filters) bool
- func RunMigrations(ctx context.Context, dbName string)
- func SessionMatchesQuery(session *model.Session, filters listener.Filters) bool
- func TraceMatchesQuery(trace *TraceRow, filters listener.Filters) bool
- type AggregatedMetricResults
- type AlertStateChangeRow
- type BlockNumberInfo
- type ClickhouseErrorGroup
- type ClickhouseErrorObject
- type ClickhouseField
- type ClickhouseSession
- type ClickhouseTraceRow
- type Client
- func (client *Client) AggregateMetricStates(ctx context.Context, metricId string, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.MetricBucket, error)
- func (client *Client) AllKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) AllKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) BatchWriteLogRows(ctx context.Context, logRows []*LogRow) error
- func (client *Client) BatchWriteSessionEventRows(ctx context.Context, eventRows []*SessionEventRow) error
- func (client *Client) BatchWriteTraceRows(ctx context.Context, traceRows []*ClickhouseTraceRow) error
- func (client *Client) DeleteSessions(ctx context.Context, projectId int, sessionIds []int) error
- func (client *Client) ErrorsKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) ErrorsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) EventsKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) EventsKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) EventsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) ExistingTraceIds(ctx context.Context, projectID int, traceIDs []string, startDate time.Time, ...) ([]string, error)
- func (client *Client) GetAlertingAlertStateChanges(ctx context.Context, projectId int, alertId int, startDate time.Time, ...) ([]*modelInputs.AlertStateChange, int64, error)
- func (client *Client) GetBlockNumbers(ctx context.Context, metricId string, startDate time.Time, endDate time.Time) ([]BlockNumberInfo, error)
- func (client *Client) GetConn() driver.Conn
- func (client *Client) GetLastAlertStateChanges(ctx context.Context, projectId int, alertId int) ([]*modelInputs.AlertStateChange, error)
- func (client *Client) GetLastAlertingStates(ctx context.Context, projectId int, alertId int, startDate time.Time, ...) ([]modelInputs.AlertStateChange, error)
- func (client *Client) HealthCheck(ctx context.Context) error
- func (client *Client) LogsKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) LogsKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) LogsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) MetricsKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) MetricsKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) MetricsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) QueryErrorFieldValues(ctx context.Context, projectId int, count int, fieldName string, query string, ...) ([]string, error)
- func (client *Client) QueryErrorGroupAggregateFrequency(ctx context.Context, projectId int, errorGroupIds []int) ([]*modelInputs.ErrorDistributionItem, error)
- func (client *Client) QueryErrorGroupFrequencies(ctx context.Context, projectId int, errorGroupIds []int, ...) ([]*modelInputs.ErrorDistributionItem, error)
- func (client *Client) QueryErrorGroupIdsDeprecated(ctx context.Context, projectId int, count int, ...) ([]int64, int64, error)
- func (client *Client) QueryErrorGroupOccurrences(ctx context.Context, projectId int, errorGroupIds []int) (map[int]ErrorGroupOccurence, error)
- func (client *Client) QueryErrorGroupTags(ctx context.Context, projectId int, errorGroupId int) ([]*modelInputs.ErrorGroupTagAggregation, error)
- func (client *Client) QueryErrorGroups(ctx context.Context, projectId int, count int, params modelInputs.QueryInput, ...) ([]int64, int64, error)
- func (client *Client) QueryErrorHistogramDeprecated(ctx context.Context, projectId int, query modelInputs.ClickhouseQuery, ...) ([]time.Time, []int64, error)
- func (client *Client) QueryErrorObjects(ctx context.Context, projectId int, errorGroupId *int, count int, ...) ([]int64, int64, error)
- func (client *Client) QueryErrorObjectsHistogram(ctx context.Context, projectId int, params modelInputs.QueryInput, ...) ([]time.Time, []int64, error)
- func (client *Client) QueryEventSessionIds(ctx context.Context, projectId int, count int, params modelInputs.QueryInput, ...) ([]int64, int64, error)
- func (client *Client) QueryFieldNames(ctx context.Context, projectId int, start time.Time, end time.Time) ([]*model.Field, error)
- func (client *Client) QueryFieldValues(ctx context.Context, projectId int, count int, fieldType string, ...) ([]string, error)
- func (client *Client) QuerySessionCustomMetrics(ctx context.Context, projectId int, sessionSecureId string, ...) ([]*model.Metric, error)
- func (client *Client) QuerySessionHistogram(ctx context.Context, admin *model.Admin, projectId int, ...) ([]time.Time, []int64, []int64, []int64, []int64, []int64, error)
- func (client *Client) QuerySessionHistogramDeprecated(ctx context.Context, admin *model.Admin, projectId int, ...) ([]time.Time, []int64, []int64, []int64, error)
- func (client *Client) QuerySessionIds(ctx context.Context, admin *model.Admin, projectId int, count int, ...) ([]int64, int64, int64, int64, bool, error)
- func (client *Client) QuerySessionIdsDeprecated(ctx context.Context, admin *model.Admin, projectId int, count int, ...) ([]int64, int64, bool, error)
- func (client *Client) ReadErrorsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadEventMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadEventsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadLogs(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.LogConnection, error)
- func (client *Client) ReadLogsDailyAverage(ctx context.Context, projectIds []int, ...) (float64, error)
- func (client *Client) ReadLogsDailySum(ctx context.Context, projectIds []int, ...) (uint64, error)
- func (client *Client) ReadLogsHistogram(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.LogsHistogram, error)
- func (client *Client) ReadLogsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadLogsTotalCount(ctx context.Context, projectID int, params modelInputs.QueryInput) (uint64, error)
- func (client *Client) ReadMetrics(ctx context.Context, input ReadMetricsInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadSessionLogs(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogEdge, error)
- func (client *Client) ReadSessionsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadTrace(ctx context.Context, projectID int, traceID string, timestamp time.Time) ([]*modelInputs.Trace, error)
- func (client *Client) ReadTraces(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.TraceConnection, error)
- func (client *Client) ReadTracesDailyAverage(ctx context.Context, projectIds []int, ...) (float64, error)
- func (client *Client) ReadTracesDailySum(ctx context.Context, projectIds []int, ...) (uint64, error)
- func (client *Client) ReadTracesMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, ...) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceErrorCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceEventCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceLogCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceMetricCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceSessionCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) ReadWorkspaceTraceCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
- func (client *Client) SessionsKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) SessionsKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) SessionsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) TracesKeyValues(ctx context.Context, projectID int, keyName string, startDate time.Time, ...) ([]string, error)
- func (client *Client) TracesKeys(ctx context.Context, projectID int, startDate time.Time, endDate time.Time, ...) ([]*modelInputs.QueryKey, error)
- func (client *Client) TracesLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
- func (client *Client) WriteAlertStateChanges(ctx context.Context, projectId int, alertStates []modelInputs.AlertStateChange) error
- func (client *Client) WriteErrorGroups(ctx context.Context, groups []*model.ErrorGroup) error
- func (client *Client) WriteErrorObjects(ctx context.Context, objects []*model.ErrorObject, sessions []*model.Session) error
- func (client *Client) WriteSessions(ctx context.Context, sessions []*model.Session) error
- type Connection
- type Edge
- type ErrorGroupOccurence
- type Event
- type FieldType
- type Link
- type LogRow
- type LogRowOption
- func WithBody(ctx context.Context, body string) LogRowOption
- func WithEnvironment(environment string) LogRowOption
- func WithLogAttributes(attributes map[string]string) LogRowOption
- func WithSecureSessionID(secureSessionID string) LogRowOption
- func WithServiceName(serviceName string) LogRowOption
- func WithServiceVersion(version string) LogRowOption
- func WithSeverityText(severityText string) LogRowOption
- func WithSource(source modelInputs.LogSource) LogRowOption
- func WithSpanID(spanID string) LogRowOption
- func WithTraceID(traceID string) LogRowOption
- type Operator
- type Pagination
- type ReadMetricsInput
- type Rule
- type SampleableTableConfig
- type SamplingStats
- type SavedMetricState
- type SessionEventRow
- type TimeUnit
- type TraceRow
- func (t *TraceRow) AsClickhouseTraceRow() *ClickhouseTraceRow
- func (t *TraceRow) WithDuration(startTime time.Time, endTime time.Time) *TraceRow
- func (t *TraceRow) WithEnvironment(environment string) *TraceRow
- func (t *TraceRow) WithEvents(events []map[string]any) *TraceRow
- func (t *TraceRow) WithHasErrors(hasErrors bool) *TraceRow
- func (t *TraceRow) WithLinks(links []map[string]any) *TraceRow
- func (t *TraceRow) WithParentSpanId(parentSpanId string) *TraceRow
- func (t *TraceRow) WithSecureSessionId(sessionId string) *TraceRow
- func (t *TraceRow) WithServiceName(serviceName string) *TraceRow
- func (t *TraceRow) WithServiceVersion(serviceVersion string) *TraceRow
- func (t *TraceRow) WithSpanId(spanId string) *TraceRow
- func (t *TraceRow) WithSpanKind(spanKind string) *TraceRow
- func (t *TraceRow) WithSpanName(spanName string) *TraceRow
- func (t *TraceRow) WithStatusCode(statusCode string) *TraceRow
- func (t *TraceRow) WithStatusMessage(statusMessage string) *TraceRow
- func (t *TraceRow) WithTraceAttributes(attributes map[string]string) *TraceRow
- func (t *TraceRow) WithTraceId(traceId string) *TraceRow
- func (t *TraceRow) WithTraceState(traceState string) *TraceRow
Constants ¶
View Source
const AlertStateChangesTable = "alert_state_changes"
View Source
const AllKeyValuesMaxRows = 100_000_000
View Source
const DbPrefix = "db."
View Source
const ErrorGroupsTable = "error_groups"
View Source
const ErrorObjectsTable = "error_objects"
View Source
const EventKeyValuesTable = "event_key_values_new"
View Source
const EventKeysTable = "event_keys_new"
View Source
const EventPrefix = "event."
View Source
const FieldsTable = "fields"
View Source
const HighlightKeyKey = "highlight.key"
View Source
const HighlightTypeKey = "highlight.type"
View Source
const HttpPrefix = "http."
View Source
const HttpRequestBodyKey = "http.request.body"
View Source
const HttpResponseBodyKey = "http.response.body"
View Source
const HttpUrlKey = "http.url"
View Source
const KeyValuesLimit int = 50
View Source
const KeyValuesMaxRows = 1_000_000
View Source
const KeysMaxRows = 1_000_000
View Source
const LogKeyValuesTable = "log_key_values"
View Source
const LogKeysTable = "log_keys"
View Source
const LogsLimit int = 50
View Source
const LogsSamplingTable = "logs_sampling"
View Source
const LogsTable = "logs"
View Source
const MaxBuckets = 240
View Source
const MetricHistoryMaxLookback = time.Hour
View Source
const MetricHistoryTable = "metric_history"
View Source
const MetricNamesTable = "trace_metrics"
View Source
const NoLimit = 1_000_000_000_000
View Source
const OrderBackwardInverted = "Timestamp DESC, UUID DESC"
View Source
const OrderBackwardNatural = "Timestamp ASC, UUID ASC"
View Source
const OrderForwardInverted = "Timestamp ASC, UUID ASC"
View Source
const OrderForwardNatural = "Timestamp DESC, UUID DESC"
View Source
const OsPrefix = "os."
View Source
const ProcessPrefix = "process."
View Source
const SamplingRows = 20_000_000
View Source
const SessionEventsTable = "session_events"
View Source
const SessionEventsView = "session_events_vw"
View Source
const SessionKeysTable = "session_keys"
View Source
const SessionsJoinedTable = "sessions_joined_vw"
View Source
const SessionsTable = "sessions"
View Source
const TelemetryPrefix = "telemetry."
View Source
const TraceAttributeValueLengthLimit = 2 << 15
View Source
const TraceKeyValuesTable = "trace_key_values"
View Source
const TraceKeysTable = "trace_keys"
View Source
const TracesSamplingTable = "traces_sampling_new"
View Source
const TracesTable = "traces"
View Source
const WsPrefix = "ws."
Variables ¶
View Source
var ( ServerAddr = env.Config.ClickhouseAddress PrimaryDatabase = env.Config.ClickhouseDatabase // typically 'default', clickhouse needs an existing database to handle connections TestDatabase = env.Config.ClickhouseTestDatabase Username = env.Config.ClickhouseUsername Password = env.Config.ClickhousePassword )
View Source
var BackendErrorObjectInputConfig = model.TableConfig{ KeysToColumns: map[string]string{ string(modelInputs.ReservedErrorsJoinedKeyEnvironment): "Environment", string(modelInputs.ReservedErrorsJoinedKeyEvent): "Event", string(modelInputs.ReservedErrorsJoinedKeyHasSession): "SessionSecureID", string(modelInputs.ReservedErrorsJoinedKeyServiceName): "Service.Name", string(modelInputs.ReservedErrorsJoinedKeyServiceVersion): "Service.Version", string(modelInputs.ReservedErrorsJoinedKeyTimestamp): "Timestamp", string(modelInputs.ReservedErrorsJoinedKeyType): "Type", string(modelInputs.ReservedErrorsJoinedKeyVisitedURL): "URL", }, BodyColumn: "Event", ReservedKeys: reservedErrorsJoinedKeys, }
View Source
var ErrorGroupsTableConfig = model.TableConfig{ TableName: ErrorGroupsTable, KeysToColumns: map[string]string{ string(modelInputs.ReservedErrorGroupKeyEvent): "Event", string(modelInputs.ReservedErrorGroupKeySecureID): "SecureID", string(modelInputs.ReservedErrorGroupKeyStatus): "Status", string(modelInputs.ReservedErrorGroupKeyTag): "ErrorTagTitle", string(modelInputs.ReservedErrorGroupKeyType): "Type", }, BodyColumn: "Event", ReservedKeys: reservedErrorGroupKeys, }
View Source
var ErrorObjectsTableConfig = model.TableConfig{ TableName: ErrorObjectsTable, KeysToColumns: map[string]string{ string(modelInputs.ReservedErrorObjectKeyBrowser): "Browser", string(modelInputs.ReservedErrorObjectKeyClientID): "ClientID", string(modelInputs.ReservedErrorObjectKeyEnvironment): "Environment", string(modelInputs.ReservedErrorObjectKeyHasSession): "HasSession", string(modelInputs.ReservedErrorObjectKeyOsName): "OSName", string(modelInputs.ReservedErrorObjectKeySecureSessionID): "SecureSessionID", string(modelInputs.ReservedErrorObjectKeyServiceName): "ServiceName", string(modelInputs.ReservedErrorObjectKeyServiceVersion): "ServiceVersion", string(modelInputs.ReservedErrorObjectKeyTimestamp): "Timestamp", string(modelInputs.ReservedErrorObjectKeyTraceID): "TraceID", string(modelInputs.ReservedErrorObjectKeyVisitedURL): "VisitedURL", }, ReservedKeys: reservedErrorObjectKeys, }
View Source
var ErrorsJoinedTableConfig = model.TableConfig{ TableName: "errors_joined_vw", KeysToColumns: map[string]string{ string(modelInputs.ReservedErrorsJoinedKeyID): "ID", string(modelInputs.ReservedErrorsJoinedKeyBrowser): "Browser", string(modelInputs.ReservedErrorsJoinedKeyClientID): "ClientID", string(modelInputs.ReservedErrorsJoinedKeyEnvironment): "Environment", string(modelInputs.ReservedErrorsJoinedKeyEvent): "Event", string(modelInputs.ReservedErrorsJoinedKeyHasSession): "HasSession", string(modelInputs.ReservedErrorsJoinedKeyOsName): "OSName", string(modelInputs.ReservedErrorsJoinedKeySecureID): "SecureID", string(modelInputs.ReservedErrorsJoinedKeySecureSessionID): "SecureSessionID", string(modelInputs.ReservedErrorsJoinedKeyServiceName): "ServiceName", string(modelInputs.ReservedErrorsJoinedKeyServiceVersion): "ServiceVersion", string(modelInputs.ReservedErrorsJoinedKeyStatus): "Status", string(modelInputs.ReservedErrorsJoinedKeyTag): "ErrorTagTitle", string(modelInputs.ReservedErrorsJoinedKeyTimestamp): "Timestamp", string(modelInputs.ReservedErrorsJoinedKeyTraceID): "TraceID", string(modelInputs.ReservedErrorsJoinedKeyType): "Type", string(modelInputs.ReservedErrorsJoinedKeyVisitedURL): "VisitedURL", }, BodyColumn: "Event", ReservedKeys: reservedErrorsJoinedKeys, }
View Source
var ErrorsSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var EventsSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var LogsSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var LogsTableConfig = model.TableConfig{ TableName: LogsTable, KeysToColumns: logKeysToColumns, ReservedKeys: reservedLogKeys, BodyColumn: "Body", SeverityColumn: "SeverityText", AttributesColumns: []model.ColumnMapping{{Column: "LogAttributes"}}, SelectColumns: []string{ "ProjectId", "Timestamp", "UUID", "SeverityText", "Body", "LogAttributes", "TraceId", "SpanId", "SecureSessionId", "Source", "ServiceName", "ServiceVersion", "Environment", }, }
View Source
var MetricsSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var SessionsJoinedTableConfig = model.TableConfig{ TableName: SessionsJoinedTable, AttributesColumns: []model.ColumnMapping{{Column: "RelevantFields"}}, AttributesTable: "fields", BodyColumn: `concat(coalesce(nullif(arrayFilter((k, v) -> k = 'email', RelevantFields) [1].2,''), nullif(Identifier, ''), nullif(arrayFilter((k, v) -> k = 'device_id', RelevantFields) [1].2, ''), 'unidentified'), ': ', City, if(City != '', ', ', ''), Country)`, KeysToColumns: map[string]string{ string(modelInputs.ReservedSessionKeyActiveLength): "ActiveLength", string(modelInputs.ReservedSessionKeyServiceVersion): "AppVersion", string(modelInputs.ReservedSessionKeyBrowserName): "BrowserName", string(modelInputs.ReservedSessionKeyBrowserVersion): "BrowserVersion", string(modelInputs.ReservedSessionKeyCity): "City", string(modelInputs.ReservedSessionKeyCompleted): "Processed", string(modelInputs.ReservedSessionKeyCountry): "Country", string(modelInputs.ReservedSessionKeyEnvironment): "Environment", string(modelInputs.ReservedSessionKeyExcluded): "Excluded", string(modelInputs.ReservedSessionKeyFirstTime): "FirstTime", string(modelInputs.ReservedSessionKeyHasComments): "HasComments", string(modelInputs.ReservedSessionKeyHasErrors): "HasErrors", string(modelInputs.ReservedSessionKeyHasRageClicks): "HasRageClicks", string(modelInputs.ReservedSessionKeyIdentified): "Identified", string(modelInputs.ReservedSessionKeyIdentifier): "Identifier", string(modelInputs.ReservedSessionKeyIP): "IP", string(modelInputs.ReservedSessionKeyLength): "Length", string(modelInputs.ReservedSessionKeyNormalness): "Normalness", string(modelInputs.ReservedSessionKeyOsName): "OSName", string(modelInputs.ReservedSessionKeyOsVersion): "OSVersion", string(modelInputs.ReservedSessionKeyPagesVisited): "PagesVisited", string(modelInputs.ReservedSessionKeySecureID): "SecureID", string(modelInputs.ReservedSessionKeyState): "State", string(modelInputs.ReservedSessionKeyTimestamp): "Timestamp", string(modelInputs.ReservedSessionKeyViewedByAnyone): "Viewed", string(modelInputs.ReservedSessionKeyWithinBillingQuota): "WithinBillingQuota", string(modelInputs.ReservedSessionKeyUpdatedAt): "UpdatedAt", string(modelInputs.ReservedSessionKeyViewed): "Viewed", string(modelInputs.ReservedSessionKeyProcessed): "Processed", string(modelInputs.ReservedSessionKeyLocState): "State", }, ReservedKeys: reservedSessionKeys, IgnoredFilters: map[string]bool{ modelInputs.ReservedSessionKeySample.String(): true, modelInputs.ReservedSessionKeyViewedByMe.String(): true, }, DefaultFilter: "excluded=false", }
View Source
var SessionsSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var SessionsTableConfig = model.TableConfig{ TableName: SessionsTable, KeysToColumns: fieldMap, AttributesColumns: []model.ColumnMapping{{Column: "Fields"}}, ReservedKeys: lo.Map(modelInputs.AllReservedSessionKey, func(item modelInputs.ReservedSessionKey, _ int) string { return item.String() }), }
View Source
var TracesSampleableTableConfig = SampleableTableConfig{ // contains filtered or unexported fields }
View Source
var TracesTableConfig = model.TableConfig{ TableName: TracesTableNoDefaultConfig.TableName, KeysToColumns: TracesTableNoDefaultConfig.KeysToColumns, ReservedKeys: TracesTableNoDefaultConfig.ReservedKeys, BodyColumn: TracesTableNoDefaultConfig.BodyColumn, AttributesColumns: TracesTableNoDefaultConfig.AttributesColumns, SelectColumns: TracesTableNoDefaultConfig.SelectColumns, DefaultFilter: fmt.Sprintf("%s!=%s %s!=%s", modelInputs.ReservedTraceKeySpanName, highlight.MetricSpanName, modelInputs.ReservedTraceKeyHighlightType, highlight.TraceTypeHighlightInternal), }
View Source
var TracesTableNoDefaultConfig = model.TableConfig{ TableName: TracesTable, KeysToColumns: traceKeysToColumns, ReservedKeys: reservedTraceKeys, BodyColumn: "SpanName", AttributesColumns: attributesColumns, SelectColumns: traceColumns, }
Functions ¶
func ErrorMatchesQuery ¶
func ErrorMatchesQuery(errorObject *model2.BackendErrorObjectInput, filters listener.Filters) bool
func GetEventsQueryImpl ¶
func GetEventsQueryImpl(params modelInputs.QueryInput, projectId int, selectColumns string, orderBy *string, limit *int, offset *int) (string, []interface{}, error)
func GetPostgresConnectionString ¶
func GetPostgresConnectionString() string
func GetSessionsQueryImpl ¶
func KeyValuesAggregated ¶
func KeysAggregated ¶
func RunMigrations ¶
func SessionMatchesQuery ¶
Types ¶
type AggregatedMetricResults ¶
type AlertStateChangeRow ¶
type BlockNumberInfo ¶
type ClickhouseErrorGroup ¶
type ClickhouseErrorObject ¶
type ClickhouseField ¶
type ClickhouseSession ¶
type ClickhouseSession struct { ID int64 ProjectID int32 PagesVisited int32 ViewedByAdmins clickhouse.ArraySet FieldKeys clickhouse.ArraySet FieldKeyValues clickhouse.ArraySet CreatedAt int64 UpdatedAt int64 SecureID string Identified bool Identifier string IP string City string State string Country string OSName string OSVersion string BrowserName string BrowserVersion string Processed *bool HasComments bool HasRageClicks *bool HasErrors *bool Length int64 ActiveLength int64 Environment string AppVersion *string FirstTime *bool Viewed *bool WithinBillingQuota *bool EventCounts *string Excluded bool Normalness *float64 }
type ClickhouseTraceRow ¶
type ClickhouseTraceRow struct { Timestamp time.Time UUID string TraceId string SpanId string ParentSpanId string ProjectId uint32 SecureSessionId string TraceState string SpanName string SpanKind string Duration int64 ServiceName string ServiceVersion string TraceAttributes map[string]string StatusCode string StatusMessage string Environment string HasErrors bool EventsTimestamp []time.Time `json:"Events.Timestamp" ch:"Events.Timestamp"` EventsName []string `json:"Events.Name" ch:"Events.Name"` EventsAttributes []map[string]string `json:"Events.Attributes" ch:"Events.Attributes"` LinksTraceId []string `json:"Links.TraceId" ch:"Links.TraceId"` LinksSpanId []string `json:"Links.SpanId" ch:"Links.SpanId"` LinksTraceState []string `json:"Links.TraceState" ch:"Links.TraceState"` LinksAttributes []map[string]string `json:"Links.Attributes" ch:"Links.Attributes"` HttpResponseBody string HttpRequestBody string HttpUrl string HighlightKey string HighlightType string HttpAttributes map[string]string ProcessAttributes map[string]string OsAttributes map[string]string TelemetryAttributes map[string]string WsAttributes map[string]string EventAttributes map[string]string DbAttributes map[string]string }
func ConvertTraceRow ¶
func ConvertTraceRow(traceRow *TraceRow) *ClickhouseTraceRow
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func SetupClickhouseTestDB ¶
func (*Client) AggregateMetricStates ¶
func (client *Client) AggregateMetricStates(ctx context.Context, metricId string, startDate time.Time, endDate time.Time, interval time.Duration, aggregator modelInputs.MetricAggregator, windowSeconds *int) ([]*modelInputs.MetricBucket, error)
func (*Client) AllKeyValues ¶
func (*Client) BatchWriteLogRows ¶
func (*Client) BatchWriteSessionEventRows ¶
func (client *Client) BatchWriteSessionEventRows(ctx context.Context, eventRows []*SessionEventRow) error
func (*Client) BatchWriteTraceRows ¶
func (client *Client) BatchWriteTraceRows(ctx context.Context, traceRows []*ClickhouseTraceRow) error
func (*Client) DeleteSessions ¶
func (*Client) ErrorsKeyValues ¶
func (*Client) ErrorsLogLines ¶
func (client *Client) ErrorsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) EventsKeyValues ¶
func (*Client) EventsKeys ¶
func (*Client) EventsLogLines ¶
func (client *Client) EventsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) ExistingTraceIds ¶
func (*Client) GetAlertingAlertStateChanges ¶
func (*Client) GetBlockNumbers ¶
func (*Client) GetLastAlertStateChanges ¶
func (client *Client) GetLastAlertStateChanges(ctx context.Context, projectId int, alertId int) ([]*modelInputs.AlertStateChange, error)
func (*Client) GetLastAlertingStates ¶
func (*Client) LogsKeyValues ¶
func (*Client) LogsLogLines ¶
func (client *Client) LogsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) MetricsKeyValues ¶
func (*Client) MetricsKeys ¶
func (*Client) MetricsLogLines ¶
func (client *Client) MetricsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) QueryErrorFieldValues ¶
func (*Client) QueryErrorGroupAggregateFrequency ¶
func (client *Client) QueryErrorGroupAggregateFrequency(ctx context.Context, projectId int, errorGroupIds []int) ([]*modelInputs.ErrorDistributionItem, error)
func (*Client) QueryErrorGroupFrequencies ¶
func (client *Client) QueryErrorGroupFrequencies(ctx context.Context, projectId int, errorGroupIds []int, params modelInputs.ErrorGroupFrequenciesParamsInput) ([]*modelInputs.ErrorDistributionItem, error)
func (*Client) QueryErrorGroupIdsDeprecated ¶
func (*Client) QueryErrorGroupOccurrences ¶
func (*Client) QueryErrorGroupTags ¶
func (client *Client) QueryErrorGroupTags(ctx context.Context, projectId int, errorGroupId int) ([]*modelInputs.ErrorGroupTagAggregation, error)
func (*Client) QueryErrorGroups ¶
func (*Client) QueryErrorHistogramDeprecated ¶
func (client *Client) QueryErrorHistogramDeprecated(ctx context.Context, projectId int, query modelInputs.ClickhouseQuery, options modelInputs.DateHistogramOptions) ([]time.Time, []int64, error)
func (*Client) QueryErrorObjects ¶
func (*Client) QueryErrorObjectsHistogram ¶
func (client *Client) QueryErrorObjectsHistogram(ctx context.Context, projectId int, params modelInputs.QueryInput, options modelInputs.DateHistogramOptions) ([]time.Time, []int64, error)
func (*Client) QueryEventSessionIds ¶
func (*Client) QueryFieldNames ¶
func (*Client) QueryFieldValues ¶
func (*Client) QuerySessionCustomMetrics ¶
func (*Client) QuerySessionHistogram ¶
func (client *Client) QuerySessionHistogram(ctx context.Context, admin *model.Admin, projectId int, params modelInputs.QueryInput, retentionDate time.Time, options modelInputs.DateHistogramOptions) ([]time.Time, []int64, []int64, []int64, []int64, []int64, error)
func (*Client) QuerySessionHistogramDeprecated ¶
func (client *Client) QuerySessionHistogramDeprecated(ctx context.Context, admin *model.Admin, projectId int, query modelInputs.ClickhouseQuery, retentionDate time.Time, options modelInputs.DateHistogramOptions) ([]time.Time, []int64, []int64, []int64, error)
func (*Client) QuerySessionIds ¶
func (*Client) QuerySessionIdsDeprecated ¶
func (*Client) ReadErrorsMetrics ¶
func (client *Client) ReadErrorsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string, expressions []*modelInputs.MetricExpressionInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadEventMetrics ¶
func (client *Client) ReadEventMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, column *string, metricTypes []modelInputs.MetricAggregator, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadEventsMetrics ¶
func (client *Client) ReadEventsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string, expressions []*modelInputs.MetricExpressionInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadLogs ¶
func (client *Client) ReadLogs(ctx context.Context, projectID int, params modelInputs.QueryInput, pagination Pagination) (*modelInputs.LogConnection, error)
func (*Client) ReadLogsDailyAverage ¶
func (client *Client) ReadLogsDailyAverage(ctx context.Context, projectIds []int, dateRange modelInputs.DateRangeRequiredInput) (float64, error)
func (*Client) ReadLogsDailySum ¶
func (client *Client) ReadLogsDailySum(ctx context.Context, projectIds []int, dateRange modelInputs.DateRangeRequiredInput) (uint64, error)
func (*Client) ReadLogsHistogram ¶
func (client *Client) ReadLogsHistogram(ctx context.Context, projectID int, params modelInputs.QueryInput, nBuckets int) (*modelInputs.LogsHistogram, error)
func (*Client) ReadLogsMetrics ¶
func (client *Client) ReadLogsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string, expressions []*modelInputs.MetricExpressionInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadLogsTotalCount ¶
func (client *Client) ReadLogsTotalCount(ctx context.Context, projectID int, params modelInputs.QueryInput) (uint64, error)
func (*Client) ReadMetrics ¶
func (client *Client) ReadMetrics(ctx context.Context, input ReadMetricsInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadSessionLogs ¶
func (client *Client) ReadSessionLogs(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogEdge, error)
This is a lighter weight version of the previous function for loading the minimal about of data for a session
func (*Client) ReadSessionsMetrics ¶
func (client *Client) ReadSessionsMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string, expressions []*modelInputs.MetricExpressionInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadTraces ¶
func (client *Client) ReadTraces(ctx context.Context, projectID int, params modelInputs.QueryInput, pagination Pagination) (*modelInputs.TraceConnection, error)
func (*Client) ReadTracesDailyAverage ¶
func (client *Client) ReadTracesDailyAverage(ctx context.Context, projectIds []int, dateRange modelInputs.DateRangeRequiredInput) (float64, error)
func (*Client) ReadTracesDailySum ¶
func (client *Client) ReadTracesDailySum(ctx context.Context, projectIds []int, dateRange modelInputs.DateRangeRequiredInput) (uint64, error)
func (*Client) ReadTracesMetrics ¶
func (client *Client) ReadTracesMetrics(ctx context.Context, projectID int, params modelInputs.QueryInput, groupBy []string, nBuckets *int, bucketBy string, bucketWindow *int, limit *int, limitAggregator *modelInputs.MetricAggregator, limitColumn *string, expressions []*modelInputs.MetricExpressionInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceErrorCounts ¶
func (client *Client) ReadWorkspaceErrorCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceEventCounts ¶
func (client *Client) ReadWorkspaceEventCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceLogCounts ¶
func (client *Client) ReadWorkspaceLogCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceMetricCounts ¶
func (client *Client) ReadWorkspaceMetricCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceSessionCounts ¶
func (client *Client) ReadWorkspaceSessionCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) ReadWorkspaceTraceCounts ¶
func (client *Client) ReadWorkspaceTraceCounts(ctx context.Context, projectIDs []int, params modelInputs.QueryInput) (*modelInputs.MetricsBuckets, error)
func (*Client) SessionsKeyValues ¶
func (*Client) SessionsKeys ¶
func (*Client) SessionsLogLines ¶
func (client *Client) SessionsLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) TracesKeyValues ¶
func (*Client) TracesKeys ¶
func (*Client) TracesLogLines ¶
func (client *Client) TracesLogLines(ctx context.Context, projectID int, params modelInputs.QueryInput) ([]*modelInputs.LogLine, error)
func (*Client) WriteAlertStateChanges ¶
func (client *Client) WriteAlertStateChanges(ctx context.Context, projectId int, alertStates []modelInputs.AlertStateChange) error
func (*Client) WriteErrorGroups ¶
func (*Client) WriteErrorObjects ¶
type Connection ¶
type Connection[T interface{}] struct { Edges []*Edge[T] PageInfo *modelInputs.PageInfo }
type ErrorGroupOccurence ¶
type LogRow ¶
type LogRow struct { Timestamp time.Time ProjectId uint32 TraceId string SpanId string SecureSessionId string UUID string TraceFlags uint32 SeverityText string SeverityNumber int32 Source modelInputs.LogSource ServiceName string ServiceVersion string Body string LogAttributes map[string]string Environment string }
type LogRowOption ¶
type LogRowOption func(*LogRow)
func WithEnvironment ¶
func WithEnvironment(environment string) LogRowOption
func WithLogAttributes ¶
func WithLogAttributes(attributes map[string]string) LogRowOption
func WithSecureSessionID ¶
func WithSecureSessionID(secureSessionID string) LogRowOption
func WithServiceName ¶
func WithServiceName(serviceName string) LogRowOption
func WithServiceVersion ¶
func WithServiceVersion(version string) LogRowOption
func WithSeverityText ¶
func WithSeverityText(severityText string) LogRowOption
func WithSource ¶
func WithSource(source modelInputs.LogSource) LogRowOption
func WithSpanID ¶
func WithSpanID(spanID string) LogRowOption
func WithTraceID ¶
func WithTraceID(traceID string) LogRowOption
type Operator ¶
type Operator string
const ( Is Operator = "is" Contains Operator = "contains" Exists Operator = "exists" Between Operator = "between" BetweenTime Operator = "between_time" BetweenDate Operator = "between_date" Matches Operator = "matches" IsNot Operator = "is_not" NotContains Operator = "not_contains" NotExists Operator = "not_exists" NotBetween Operator = "not_between" NotBetweenTime Operator = "not_between_time" NotBetweenDate Operator = "not_between_date" NotMatches Operator = "not_matches" )
type Pagination ¶
type Pagination struct { After *string Before *string At *string Direction modelInputs.SortDirection CountOnly bool Limit *int }
type ReadMetricsInput ¶
type ReadMetricsInput struct { SampleableConfig SampleableTableConfig ProjectIDs []int Params modelInputs.QueryInput GroupBy []string BucketCount *int BucketWindow *int BucketBy string Limit *int LimitAggregator *modelInputs.MetricAggregator LimitColumn *string SavedMetricState *SavedMetricState PredictionSettings *modelInputs.PredictionSettings NoBucketMax bool Expressions []*modelInputs.MetricExpressionInput }
type SampleableTableConfig ¶
type SampleableTableConfig struct {
// contains filtered or unexported fields
}
type SamplingStats ¶
type SavedMetricState ¶
type SavedMetricState struct { MetricId string BlockNumberInfo []BlockNumberInfo }
type SessionEventRow ¶
type TraceRow ¶
type TraceRow struct { Timestamp time.Time UUID string TraceId string SpanId string ParentSpanId string TraceState string SpanName string SpanKind string ServiceName string ServiceVersion string TraceAttributes map[string]string Duration int64 StatusCode string StatusMessage string Events []*Event Links []*Link ProjectId uint32 SecureSessionId string Environment string HasErrors bool }
func (*TraceRow) AsClickhouseTraceRow ¶
func (t *TraceRow) AsClickhouseTraceRow() *ClickhouseTraceRow
func (*TraceRow) WithDuration ¶
func (*TraceRow) WithEnvironment ¶
func (*TraceRow) WithHasErrors ¶
func (*TraceRow) WithParentSpanId ¶
func (*TraceRow) WithSecureSessionId ¶
func (*TraceRow) WithServiceName ¶
func (*TraceRow) WithServiceVersion ¶
func (*TraceRow) WithSpanId ¶
func (*TraceRow) WithSpanKind ¶
func (*TraceRow) WithSpanName ¶
func (*TraceRow) WithStatusCode ¶
func (*TraceRow) WithStatusMessage ¶
func (*TraceRow) WithTraceAttributes ¶
func (*TraceRow) WithTraceId ¶
func (*TraceRow) WithTraceState ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.