Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 2ad4ba3

Browse files
committed
Added LiteFS attributes to Otel span
We now include the txid and checksum to aid in debugging.
1 parent e3d90e3 commit 2ad4ba3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docker-build-resources/copy-database.sh

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ if test -f "$path"; then
2727
sourcePath="$LITEFS_DB_DIRECTORY/$name"
2828
destPath="/host-data/$(date +"%s")-$name"
2929

30+
# Extract LiteFS position for observability
31+
pos=$(cat "$LITEFS_DB_DIRECTORY/$name-pos")
32+
txid=$(echo "$pos" | cut -d "/" -f 1)
33+
checksum=$(echo "$pos" | cut -d "/" -f 2)
34+
3035
stat "$sourcePath"
3136

3237
if test -s "$sourcePath"; then
@@ -42,6 +47,8 @@ if test -f "$path"; then
4247
custom_resource_attributes=(
4348
"domain_data_generated_at:$generatedAt"
4449
"domain_data_schema_version:$schemaVersion"
50+
"litefs_txid:$txid"
51+
"litefs_checksum:$checksum"
4552
)
4653
linkedTraceId=$(sqlite3 "$sourcePath" "SELECT linked_trace_id FROM metadata;")
4754
linkedTraceState=$(sqlite3 "$sourcePath" "SELECT linked_trace_state FROM metadata;")

0 commit comments

Comments
 (0)