diff --git a/measure-backend/measure-go/events.go b/measure-backend/measure-go/events.go index 5bc09bbb9..2ddfd7965 100644 --- a/measure-backend/measure-go/events.go +++ b/measure-backend/measure-go/events.go @@ -56,8 +56,8 @@ var columns = []string{ "resource.measure_sdk_version", "exception.thread_name", "exception.handled", - "exception.exceptions", - "exception.threads", + "exception_exceptions", + "exception_threads", "string.severity_text", "string.string", "gesture_long_click.target", @@ -116,7 +116,23 @@ type Frame struct { } func (f *Frame) encode() string { - return fmt.Sprintf("(%d, %d, '%s', '%s', '%s', '%s')", f.LineNum, f.ColNum, f.ModuleName, f.FileName, f.ClassName, f.MethodName) + moduleName := f.ModuleName + fileName := f.FileName + className := f.ClassName + methodName := f.MethodName + if f.ModuleName == "" { + moduleName = "__blank__" + } + if f.FileName == "" { + fileName = "__blank__" + } + if f.ClassName == "" { + className = "__blank__" + } + if f.MethodName == "" { + methodName = "__blank__" + } + return fmt.Sprintf("(%d, %d, '%s', '%s', '%s', '%s')", f.LineNum, f.ColNum, moduleName, fileName, className, methodName) } type Frames []Frame diff --git a/measure-backend/sql-statements/clickhouse/create-events-table-2.sql b/measure-backend/sql-statements/clickhouse/create-events-table-2.sql index 9988ac621..b612ac3a5 100644 --- a/measure-backend/sql-statements/clickhouse/create-events-table-2.sql +++ b/measure-backend/sql-statements/clickhouse/create-events-table-2.sql @@ -28,8 +28,9 @@ create table if not exists events_test_2 /* exceptions */ `exception.thread_name` LowCardinality(String), `exception.handled` Bool, - `exception.exceptions` Array(Tuple(LowCardinality(String), LowCardinality(String), Array(Tuple(Int32, Int32, LowCardinality(String), LowCardinality(String), LowCardinality(String), LowCardinality(String))))), - `exception.threads` Array(Tuple(LowCardinality(String), Array(Tuple(Int32, Int32, LowCardinality(String), LowCardinality(String), LowCardinality(String), LowCardinality(String))))), + /* uses undescore because clickhouse treats dot as a nested data structure and tries to match the length of exception.exceptions & exception.threads */ + `exception_exceptions` Array(Tuple(LowCardinality(String), LowCardinality(String), Array(Tuple(Int32, Int32, LowCardinality(String), LowCardinality(String), LowCardinality(String), LowCardinality(String))))), + `exception_threads` Array(Tuple(LowCardinality(String), Array(Tuple(Int32, Int32, LowCardinality(String), LowCardinality(String), LowCardinality(String), LowCardinality(String))))), /* string */ `string.severity_text` LowCardinality(FixedString(10)), `string.string` String,