Skip to content

Commit d539ca9

Browse files
feat(sql): swap mattn/sqlite with modernc.org/sqlite (#9343)
* feat(sql): swap mattn/sqlite with modernc.org/sqlite (#9325) * feat(sql): swap mattn/sqlite with modernc.org/sqlite * feat(sql): revert the dashboard testing changes * feat(sql): enable WAL mode for sqlite * feat(sql): revert enable WAL mode for sqlite * feat(sql): use sensible defaults for busy_timeout * feat(sql): add ldflags * feat(sql): enable WAL mode for sqlite * feat(sql): some fixes * feat(sql): some fixes * feat(sql): fix yarn lock and config defaults * feat(sql): update the defaults in example.conf * feat(sql): remove wal mode from integration tests
1 parent c8194e9 commit d539ca9

File tree

19 files changed

+76
-75
lines changed

19 files changed

+76
-75
lines changed

.github/workflows/build-community.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: build-community
33
on:
44
push:
55
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+'
7-
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
88

99
defaults:
1010
run:
@@ -69,14 +69,13 @@ jobs:
6969
GO_BUILD_CONTEXT: ./cmd/community
7070
GO_BUILD_FLAGS: >-
7171
-tags timetzdata
72-
-ldflags='-linkmode external -extldflags \"-static\" -s -w
72+
-ldflags='-s -w
7373
-X github.com/SigNoz/signoz/pkg/version.version=${{ needs.prepare.outputs.version }}
7474
-X github.com/SigNoz/signoz/pkg/version.variant=community
7575
-X github.com/SigNoz/signoz/pkg/version.hash=${{ needs.prepare.outputs.hash }}
7676
-X github.com/SigNoz/signoz/pkg/version.time=${{ needs.prepare.outputs.time }}
7777
-X github.com/SigNoz/signoz/pkg/version.branch=${{ needs.prepare.outputs.branch }}
7878
-X github.com/SigNoz/signoz/pkg/analytics.key=9kRrJ7oPCGPEJLF6QjMPLt5bljFhRQBr'
79-
GO_CGO_ENABLED: 1
8079
DOCKER_BASE_IMAGES: '{"alpine": "alpine:3.20.3"}'
8180
DOCKER_DOCKERFILE_PATH: ./cmd/community/Dockerfile.multi-arch
8281
DOCKER_MANIFEST: true

.github/workflows/build-enterprise.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
JS_INPUT_ARTIFACT_CACHE_KEY: enterprise-dotenv-${{ github.sha }}
8585
JS_INPUT_ARTIFACT_PATH: frontend/.env
8686
JS_OUTPUT_ARTIFACT_CACHE_KEY: enterprise-jsbuild-${{ github.sha }}
87-
JS_OUTPUT_ARTIFACT_PATH: frontend/build
87+
JS_OUTPUT_ARTIFACT_PATH: frontend/build
8888
DOCKER_BUILD: false
8989
DOCKER_MANIFEST: false
9090
go-build:
@@ -99,7 +99,7 @@ jobs:
9999
GO_BUILD_CONTEXT: ./cmd/enterprise
100100
GO_BUILD_FLAGS: >-
101101
-tags timetzdata
102-
-ldflags='-linkmode external -extldflags \"-static\" -s -w
102+
-ldflags='-s -w
103103
-X github.com/SigNoz/signoz/pkg/version.version=${{ needs.prepare.outputs.version }}
104104
-X github.com/SigNoz/signoz/pkg/version.variant=enterprise
105105
-X github.com/SigNoz/signoz/pkg/version.hash=${{ needs.prepare.outputs.hash }}
@@ -110,7 +110,6 @@ jobs:
110110
-X github.com/SigNoz/signoz/ee/query-service/constants.ZeusURL=https://api.signoz.cloud
111111
-X github.com/SigNoz/signoz/ee/query-service/constants.LicenseSignozIo=https://license.signoz.io/api/v1
112112
-X github.com/SigNoz/signoz/pkg/analytics.key=9kRrJ7oPCGPEJLF6QjMPLt5bljFhRQBr'
113-
GO_CGO_ENABLED: 1
114113
DOCKER_BASE_IMAGES: '{"alpine": "alpine:3.20.3"}'
115114
DOCKER_DOCKERFILE_PATH: ./cmd/enterprise/Dockerfile.multi-arch
116115
DOCKER_MANIFEST: true

.github/workflows/build-staging.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
GO_BUILD_CONTEXT: ./cmd/enterprise
9999
GO_BUILD_FLAGS: >-
100100
-tags timetzdata
101-
-ldflags='-linkmode external -extldflags \"-static\" -s -w
101+
-ldflags='-s -w
102102
-X github.com/SigNoz/signoz/pkg/version.version=${{ needs.prepare.outputs.version }}
103103
-X github.com/SigNoz/signoz/pkg/version.variant=enterprise
104104
-X github.com/SigNoz/signoz/pkg/version.hash=${{ needs.prepare.outputs.hash }}
@@ -109,7 +109,6 @@ jobs:
109109
-X github.com/SigNoz/signoz/ee/query-service/constants.ZeusURL=https://api.staging.signoz.cloud
110110
-X github.com/SigNoz/signoz/ee/query-service/constants.LicenseSignozIo=https://license.staging.signoz.cloud/api/v1
111111
-X github.com/SigNoz/signoz/pkg/analytics.key=9kRrJ7oPCGPEJLF6QjMPLt5bljFhRQBr'
112-
GO_CGO_ENABLED: 1
113112
DOCKER_BASE_IMAGES: '{"alpine": "alpine:3.20.3"}'
114113
DOCKER_DOCKERFILE_PATH: ./cmd/enterprise/Dockerfile.multi-arch
115114
DOCKER_MANIFEST: true
@@ -125,4 +124,4 @@ jobs:
125124
GITHUB_SILENT: true
126125
GITHUB_REPOSITORY_NAME: charts-saas-v3-staging
127126
GITHUB_EVENT_NAME: releaser
128-
GITHUB_EVENT_PAYLOAD: "{\"deployment\": \"${{ needs.prepare.outputs.deployment }}\", \"signoz_version\": \"${{ needs.prepare.outputs.version }}\"}"
127+
GITHUB_EVENT_PAYLOAD: '{"deployment": "${{ needs.prepare.outputs.deployment }}", "signoz_version": "${{ needs.prepare.outputs.version }}"}'

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ $(GO_BUILD_ARCHS_COMMUNITY): go-build-community-%: $(TARGET_DIR)
114114
@mkdir -p $(TARGET_DIR)/$(OS)-$*
115115
@echo ">> building binary $(TARGET_DIR)/$(OS)-$*/$(NAME)-community"
116116
@if [ $* = "arm64" ]; then \
117-
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_COMMUNITY) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME)-community -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_COMMUNITY)"; \
117+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_COMMUNITY) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME)-community -ldflags "-s -w $(GO_BUILD_LDFLAGS_COMMUNITY)"; \
118118
else \
119-
CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_COMMUNITY) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME)-community -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_COMMUNITY)"; \
119+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_COMMUNITY) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME)-community -ldflags "-s -w $(GO_BUILD_LDFLAGS_COMMUNITY)"; \
120120
fi
121121

122122

@@ -127,9 +127,9 @@ $(GO_BUILD_ARCHS_ENTERPRISE): go-build-enterprise-%: $(TARGET_DIR)
127127
@mkdir -p $(TARGET_DIR)/$(OS)-$*
128128
@echo ">> building binary $(TARGET_DIR)/$(OS)-$*/$(NAME)"
129129
@if [ $* = "arm64" ]; then \
130-
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
130+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
131131
else \
132-
CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
132+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
133133
fi
134134

135135
.PHONY: go-build-enterprise-race $(GO_BUILD_ARCHS_ENTERPRISE_RACE)
@@ -139,9 +139,9 @@ $(GO_BUILD_ARCHS_ENTERPRISE_RACE): go-build-enterprise-race-%: $(TARGET_DIR)
139139
@mkdir -p $(TARGET_DIR)/$(OS)-$*
140140
@echo ">> building binary $(TARGET_DIR)/$(OS)-$*/$(NAME)"
141141
@if [ $* = "arm64" ]; then \
142-
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -race -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
142+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -race -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
143143
else \
144-
CGO_ENABLED=1 GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -race -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-linkmode external -extldflags '-static' -s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
144+
GOARCH=$* GOOS=$(OS) go build -C $(GO_BUILD_CONTEXT_ENTERPRISE) -race -tags timetzdata -o $(TARGET_DIR)/$(OS)-$*/$(NAME) -ldflags "-s -w $(GO_BUILD_LDFLAGS_ENTERPRISE)"; \
145145
fi
146146

147147
##############################################################

cmd/community/.goreleaser.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ builds:
1212
- id: signoz
1313
binary: bin/signoz
1414
main: ./cmd/community
15-
env:
16-
- CGO_ENABLED=1
17-
- >-
18-
{{- if eq .Os "linux" }}
19-
{{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }}
20-
{{- end }}
2115
goos:
2216
- linux
2317
- darwin
@@ -36,8 +30,6 @@ builds:
3630
- -X github.com/SigNoz/signoz/pkg/version.time={{ .CommitTimestamp }}
3731
- -X github.com/SigNoz/signoz/pkg/version.branch={{ .Branch }}
3832
- -X github.com/SigNoz/signoz/pkg/analytics.key=9kRrJ7oPCGPEJLF6QjMPLt5bljFhRQBr
39-
- >-
40-
{{- if eq .Os "linux" }}-linkmode external -extldflags '-static'{{- end }}
4133
mod_timestamp: "{{ .CommitTimestamp }}"
4234
tags:
4335
- timetzdata

cmd/enterprise/.goreleaser.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ builds:
1212
- id: signoz
1313
binary: bin/signoz
1414
main: ./cmd/enterprise
15-
env:
16-
- CGO_ENABLED=1
17-
- >-
18-
{{- if eq .Os "linux" }}
19-
{{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }}
20-
{{- end }}
2115
goos:
2216
- linux
2317
- darwin
@@ -40,8 +34,6 @@ builds:
4034
- -X github.com/SigNoz/signoz/ee/query-service/constants.ZeusURL=https://api.signoz.cloud
4135
- -X github.com/SigNoz/signoz/ee/query-service/constants.LicenseSignozIo=https://license.signoz.io/api/v1
4236
- -X github.com/SigNoz/signoz/pkg/analytics.key=9kRrJ7oPCGPEJLF6QjMPLt5bljFhRQBr
43-
- >-
44-
{{- if eq .Os "linux" }}-linkmode external -extldflags '-static'{{- end }}
4537
mod_timestamp: "{{ .CommitTimestamp }}"
4638
tags:
4739
- timetzdata

conf/example.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##################### SigNoz Configuration Example #####################
2-
#
2+
#
33
# Do not modify this file
44
#
55

@@ -58,7 +58,7 @@ cache:
5858
# The port on which the Redis server is running. Default is usually 6379.
5959
port: 6379
6060
# The password for authenticating with the Redis server, if required.
61-
password:
61+
password:
6262
# The Redis database number to use
6363
db: 0
6464

@@ -71,6 +71,10 @@ sqlstore:
7171
sqlite:
7272
# The path to the SQLite database file.
7373
path: /var/lib/signoz/signoz.db
74+
# Mode is the mode to use for the sqlite database.
75+
mode: delete
76+
# BusyTimeout is the timeout for the sqlite database to wait for a lock.
77+
busy_timeout: 10s
7478

7579
##################### APIServer #####################
7680
apiserver:
@@ -238,7 +242,6 @@ statsreporter:
238242
# Whether to collect identities and traits (emails).
239243
identities: true
240244

241-
242245
##################### Gateway (License only) #####################
243246
gateway:
244247
# The URL of the gateway's api.

docs/contributing/development.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Before diving in, make sure you have these tools installed:
1313
- Download from [go.dev/dl](https://go.dev/dl/)
1414
- Check [go.mod](../../go.mod#L3) for the minimum version
1515

16-
- **GCC** - Required for CGO dependencies
17-
- Download from [gcc.gnu.org](https://gcc.gnu.org/)
1816

1917
- **Node** - Powers our frontend
2018
- Download from [nodejs.org](https://nodejs.org)

frontend/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13752,7 +13752,7 @@ [email protected], on-finished@^2.4.1:
1375213752
dependencies:
1375313753
ee-first "1.1.1"
1375413754

13755-
[email protected], on-headers@~1.0.2:
13755+
on-headers@^1.1.0, on-headers@~1.0.2:
1375613756
version "1.1.0"
1375713757
resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.1.0.tgz#59da4f91c45f5f989c6e4bcedc5a3b0aed70ff65"
1375813758
integrity sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ require (
3232
github.com/knadh/koanf v1.5.0
3333
github.com/knadh/koanf/v2 v2.2.0
3434
github.com/mailru/easyjson v0.7.7
35-
github.com/mattn/go-sqlite3 v1.14.24
3635
github.com/open-telemetry/opamp-go v0.19.0
3736
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.128.0
3837
github.com/openfga/api/proto v0.0.0-20250909172242-b4b2a12f5c67
@@ -84,6 +83,7 @@ require (
8483
gopkg.in/yaml.v2 v2.4.0
8584
gopkg.in/yaml.v3 v3.0.1
8685
k8s.io/apimachinery v0.34.0
86+
modernc.org/sqlite v1.39.1
8787
)
8888

8989
require (
@@ -93,10 +93,9 @@ require (
9393
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
9494
github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.2 // indirect
9595
go.yaml.in/yaml/v2 v2.4.2 // indirect
96-
modernc.org/libc v1.66.3 // indirect
96+
modernc.org/libc v1.66.10 // indirect
9797
modernc.org/mathutil v1.7.1 // indirect
9898
modernc.org/memory v1.11.0 // indirect
99-
modernc.org/sqlite v1.39.0 // indirect
10099
)
101100

102101
require (
@@ -330,7 +329,7 @@ require (
330329
go.uber.org/mock v0.6.0 // indirect
331330
go.yaml.in/yaml/v3 v3.0.4 // indirect
332331
golang.org/x/mod v0.27.0 // indirect
333-
golang.org/x/sys v0.35.0 // indirect
332+
golang.org/x/sys v0.36.0 // indirect
334333
golang.org/x/time v0.11.0 // indirect
335334
golang.org/x/tools v0.36.0 // indirect
336335
gonum.org/v1/gonum v0.16.0 // indirect

0 commit comments

Comments
 (0)