Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 19 additions & 28 deletions internal/storage/v2/clickhouse/sql/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ INSERT INTO
status_code,
status_message,
duration,
service_name,
scope_name,
scope_version,
bool_attributes.key,
bool_attributes.value,
double_attributes.key,
Expand All @@ -31,33 +28,27 @@ INSERT INTO
str_attributes.value,
complex_attributes.key,
complex_attributes.value,
events.name,
events.timestamp,
events.bool_attributes.key,
events.bool_attributes.value,
events.double_attributes.key,
events.double_attributes.value,
events.int_attributes.key,
events.int_attributes.value,
events.str_attributes.key,
events.str_attributes.value,
events.complex_attributes.key,
events.complex_attributes.value,
links.trace_id,
links.span_id,
links.trace_state,
service_name,
scope_name,
scope_version
)
VALUES
(
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
)
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`

const SelectSpansByTraceID = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package dbmodel
import (
"encoding/base64"
"encoding/json"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -253,3 +254,14 @@ func TestPopulateComplexAttributes(t *testing.T) {
})
}
}

func jsonToPtrace(t *testing.T, filename string) ptrace.Traces {
t.Helper()
data, err := os.ReadFile(filename)
require.NoError(t, err)

unmarshaler := &ptrace.JSONUnmarshaler{}
traces, err := unmarshaler.UnmarshalTraces(data)
require.NoError(t, err)
return traces
}
Loading
Loading