Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
eeadc02
chore(signoz): pin versions: SigNoz 0.57.0
prashant-shahi Oct 28, 2024
523cbcd
chore: go mod tidy
prashant-shahi Oct 28, 2024
cdde369
Merge branch 'develop' into release/signoz-0.57.0
prashant-shahi Oct 28, 2024
b10c222
Merge pull request #6300 from SigNoz/release/signoz-0.57.0
prashant-shahi Oct 28, 2024
eaf8571
Merge branch 'main' into release/v0.58.x
prashant-shahi Nov 8, 2024
48f3b9c
chore(signoz): pin versions: SigNoz 0.58.0, SigNoz OtelCollector 0.111.8
prashant-shahi Nov 8, 2024
eb66709
Merge pull request #6405 from SigNoz/release/v0.58.x
prashant-shahi Nov 8, 2024
3f7adeb
Merge branch 'develop' into release/v0.58.x
prashant-shahi Nov 13, 2024
504bc0d
feat: ingestion limits - add toggle feature (#6430)
YounixM Nov 15, 2024
371224a
fix: show org onboarding only to cloud customers (#6451)
YounixM Nov 15, 2024
c1478c4
feat: removed dashboard uuid is all cases be it duplicate, empty or s…
SagarRajput-7 Nov 15, 2024
1bba932
Merge branch 'develop' into release/v0.58.x
prashant-shahi Nov 15, 2024
bc9c7b5
chore(signoz): pin versions: SigNoz 0.58.1
prashant-shahi Nov 15, 2024
a11aadb
Merge branch 'main' into release/v0.58.x
prashant-shahi Nov 15, 2024
77c5f17
feat: support for window based pagination in new trace v4 (#6440)
nityanandagohain Nov 15, 2024
07c24bc
Merge pull request #6452 from SigNoz/release/v0.58.x
prashant-shahi Nov 15, 2024
35f4eaa
fix: update logs struct to fix live logs (#6453)
nityanandagohain Nov 15, 2024
d859301
Merge branch 'develop' into release/v0.58.x
prashant-shahi Nov 15, 2024
0acf39a
feat: support for new enrichment logic in traces (#6438)
nityanandagohain Nov 16, 2024
cd1ec56
fix: compare op outside bounds for anomaly alert (#6458)
srikanthccv Nov 16, 2024
493ae4f
chore: add user email to log_comment (#6461)
srikanthccv Nov 16, 2024
656d1c2
chore: add missing alert telemetry (#6459)
srikanthccv Nov 16, 2024
22e61e1
[Snyk] Security upgrade alpine from 3.18.6 to 3.20.3 (#6463)
YounixM Nov 17, 2024
91bbeaf
fix: remove unwanted trace API's (#6464)
nityanandagohain Nov 18, 2024
a59e7b9
feat: add 'create channel' option in channels list and refetch alert …
ahmadshaheer Nov 18, 2024
d93f72f
chore: use the license v2 key to fill licenses v3 on startup (#6468)
vikrantgupta25 Nov 18, 2024
98a3506
fix: update TestListTsRange to return all range (#6470)
nityanandagohain Nov 19, 2024
a9ced66
Merge branch 'develop' into release/v0.58.x
prashant-shahi Nov 19, 2024
c93cf1c
fix: incorrect formula for apdex (#6460)
srikanthccv Nov 19, 2024
3ad6ff7
Merge branch 'develop' into release/v0.58.x
prashant-shahi Nov 19, 2024
9ccc686
chore(signoz): pin versions: SigNoz 0.58.2
prashant-shahi Nov 19, 2024
25484ca
Merge branch 'main' into release/v0.58.x
prashant-shahi Nov 19, 2024
c8d0f76
Merge pull request #6471 from SigNoz/release/v0.58.x
prashant-shahi Nov 19, 2024
6495602
chore: set zeusURL via build time variable (#6475)
vikrantgupta25 Nov 19, 2024
57c2326
Trace static fields and structs for trace v4. (#6469)
nityanandagohain Nov 19, 2024
c01060c
feat(key): enable edit access for gateway (#6480)
therealpandey Nov 19, 2024
0b03ff0
chore: exactly match the list licenses v2 structure with FF on (#6481)
vikrantgupta25 Nov 19, 2024
20e64b5
chore: add log events to alert history page (#6396)
ahmadshaheer Nov 20, 2024
d7bd72e
chore: update http proxy middleware (#6486)
YounixM Nov 20, 2024
f410df8
Merge branch 'main' into release/v0.59.x
prashant-shahi Nov 20, 2024
5a70123
chore(signoz): pin versions: SigNoz 0.59.0, SigNoz OtelCollector 0.111.9
prashant-shahi Nov 20, 2024
71d1e12
Merge pull request #6490 from SigNoz/release/v0.59.x
prashant-shahi Nov 20, 2024
5044861
fix: remove service overview API (#6495)
nityanandagohain Nov 20, 2024
d43adc2
feat: update clickhouse reader to support new trace schema (#6479)
nityanandagohain Nov 20, 2024
7b6bd83
Merge branch 'main' into sync/post-release-v0.59
prashant-shahi Nov 21, 2024
2dad9a3
Merge pull request #6498 from SigNoz/sync/post-release-v0.59
prashant-shahi Nov 21, 2024
e450569
feat: added the host list view and filters (#6210) (#6501)
YounixM Nov 21, 2024
e46d969
feat: ttl api for new trace tables (#6497)
nityanandagohain Nov 21, 2024
67058b2
feat: trace v4 integration (#6226)
nityanandagohain Nov 22, 2024
0c5db19
fix: fixed back navigation issue for dashboard details coming from da…
SagarRajput-7 Nov 22, 2024
a6968d4
fix: updated folder name and structure (#6488)
SagarRajput-7 Nov 22, 2024
ed6abe5
chore: enable sorting for hosts list (#6502)
srikanthccv Nov 22, 2024
7fe4f8c
chore: remove the fancy text while fetching data (#6505)
srikanthccv Nov 22, 2024
96b5e09
fix: decrease the pad angle and remove the empty legend entries (#6507)
vikrantgupta25 Nov 22, 2024
20f748f
chore: update http proxy middleware (#6499)
YounixM Nov 22, 2024
afbba1e
fix: add v2 for getServices and GetTopOperations (#6516)
nityanandagohain Nov 22, 2024
0c2a15d
fix: add settings to allow distributed_product_mode for trace panel (…
nityanandagohain Nov 22, 2024
b85f792
fix: update api's to repect the new changes in attributes table (#6526)
nityanandagohain Nov 25, 2024
2e4956c
chore: add additional info for host metrics onboarding (#6529)
srikanthccv Nov 25, 2024
24ab18d
chore: move away from parallel usages of licenses v2 and v3 (#6527)
vikrantgupta25 Nov 25, 2024
a3e57a1
fix: add telemetry for trace migration (#6537)
nityanandagohain Nov 26, 2024
328d955
Fix for running signoz-schema-migrator under docker-swarm (#6489)
Ruppsn Nov 27, 2024
486632b
Chore/qs use collector simulator from signoz otel collector (#6539)
raj-k-singh Nov 27, 2024
7cd8442
chore(signoz): pin versions: SigNoz 0.60.0, SigNoz OtelCollector 0.11…
prashant-shahi Nov 27, 2024
a320a16
Merge pull request #6546 from SigNoz/release/v0.60.x
prashant-shahi Nov 27, 2024
2bfd318
feat: improve empty hosts, incorrect metrics and no filter views (#6530)
YounixM Nov 27, 2024
6aee991
feat: handle keyboard navigations for column selection in logs explor…
YounixM Nov 27, 2024
813cd84
fix: explicit mouse move event user action (#6549)
vikrantgupta25 Nov 27, 2024
f7f8bf1
fix: add dashbard names and update logs count in telemetry (#6553)
nityanandagohain Nov 28, 2024
2b8a610
fix: fixed typo in metric view dashboard title (#6557)
SagarRajput-7 Nov 29, 2024
3d092ec
chore: update sentry react to v8 (#6569)
YounixM Dec 2, 2024
507c060
chore: remove infra monitoring ff (#6571)
YounixM Dec 2, 2024
6384b25
feat: show failed payment banner and block the workspace integration …
vikrantgupta25 Dec 2, 2024
43f856c
fix: make the entire row clickable in logs quick filters (#6574)
vikrantgupta25 Dec 3, 2024
73bcc2a
Merge branch 'main' into release/v0.61.x
prashant-shahi Dec 4, 2024
99367be
chore(signoz): pin versions: SigNoz 0.61.0, SigNoz OtelCollector 0.11…
prashant-shahi Dec 4, 2024
a383c70
Merge pull request #6591 from SigNoz/release/v0.61.x
prashant-shahi Dec 4, 2024
02d8fdb
fix: enable smart trace detail (#6596)
nityanandagohain Dec 5, 2024
d4458d6
fix(docker): otel-collector-migrator command fixed in docker-compose-…
deepakdinesh1123 Dec 7, 2024
8c62251
chore: replace the 'Get started' CTA with 'New source'
amlannandy Dec 5, 2024
31a2926
chore: replace the 'Get started' CTA with 'New source'
amlannandy Dec 9, 2024
51baf7f
feat: add byte rate to producer API (#6579)
shivanshuraj1333 Dec 9, 2024
8d26660
fix: resolve the unneccessary refetching of graphs on service details…
amlannandy Dec 7, 2024
81775c7
fix: resolve unnecessary refetching of graphs on service details page
amlannandy Dec 10, 2024
f9d4cf1
fix: smartTraceAlgo for new schema (#6602)
nityanandagohain Dec 10, 2024
32fa5a4
fix: update default alert ch queries for traces and logs (#6552)
nityanandagohain Dec 10, 2024
b25df66
fix: migration for ingestion dashboard (#6610)
nityanandagohain Dec 10, 2024
0fbfb6b
fix: fix count aggregate attribute column name (#6613)
nityanandagohain Dec 11, 2024
8c46de8
feat: added table column and row logic for the new api response struc…
SagarRajput-7 Dec 13, 2024
a1059ed
feat(signoz-ingestion-key): rename signoz-access-token to signoz-inge…
therealpandey Dec 13, 2024
e3caa6a
chore(deps): bump golang.org/x/crypto from 0.27.0 to 0.31.0 (#6638)
dependabot[bot] Dec 14, 2024
8d1c449
feat: add functionality to export dashboard as json from listing page
amlannandy Dec 4, 2024
715f8a2
feat: address comments
amlannandy Dec 5, 2024
b35b975
chore: address comments
amlannandy Dec 6, 2024
b499b10
feat: add unit test
amlannandy Dec 7, 2024
1b82136
feat: update tests
amlannandy Dec 7, 2024
2508e6f
feat: update unit test
amlannandy Dec 7, 2024
d09c4d9
feat: update unit test
amlannandy Dec 7, 2024
8a3319c
chore: address comments
amlannandy Dec 10, 2024
b333aa3
Feat: Timezone picker feature (#6474)
ahmadshaheer Dec 16, 2024
8ab0c06
Merge branch 'develop' into dashboard-list-export-json
amlannandy Dec 16, 2024
9a1cd65
feat: add functionality to export dashboard as json from listing page
amlannandy Dec 16, 2024
b29359d
fix: improve traces table ux by making the table scrollable (#6423)
ahmadshaheer Dec 16, 2024
bef5b96
chore: add queries with tag attributes v1 (#6643)
srikanthccv Dec 16, 2024
e676602
chore: use tag attributes v2 table (#6616)
srikanthccv Dec 16, 2024
951593b
feat(licenses): deprecate licenses v2 (#6626)
therealpandey Dec 16, 2024
2701ae5
fix: unable to remove query tags from the beginning when similar tags…
vikrantgupta25 Dec 16, 2024
8608f02
fix: timerange selected for traces to logs (#6634)
vikrantgupta25 Dec 16, 2024
96da21d
fix: correlation time stamps for APM to traces and logs (#6632)
vikrantgupta25 Dec 16, 2024
14fbb1f
fix(flag): add missing flag back (#6647)
therealpandey Dec 16, 2024
cd9f27a
Fix: QS: logs pipelines: better validation of pipelines being saved (…
raj-k-singh Dec 18, 2024
7031c86
fix: add flags for using trace new schema (#6651)
nityanandagohain Dec 18, 2024
83f6dea
Add support for trace_v3 schema in messaging queues (#6663)
shivanshuraj1333 Dec 18, 2024
83aa48c
update service.instance.id (#6665)
shivanshuraj1333 Dec 18, 2024
85cf4f4
fix: use placehold in limit and use proper exists (#6667)
nityanandagohain Dec 18, 2024
60dc479
fix: add bucketing (#6669)
shivanshuraj1333 Dec 18, 2024
67e822e
feat: api for trace materialization (#6646)
nityanandagohain Dec 19, 2024
7405bfb
feat: changed start and end time logic for consumer lag details (#6605)
SagarRajput-7 Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BUILD_HASH ?= $(shell git rev-parse --short HEAD)
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
BUILD_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
DEV_LICENSE_SIGNOZ_IO ?= https://staging-license.signoz.io/api/v1
ZEUS_URL ?= https://api.signoz.cloud
DEV_BUILD ?= "" # set to any non-empty value to enable dev build

# Internal variables or constants.
Expand All @@ -33,8 +34,9 @@ buildHash=${PACKAGE}/pkg/query-service/version.buildHash
buildTime=${PACKAGE}/pkg/query-service/version.buildTime
gitBranch=${PACKAGE}/pkg/query-service/version.gitBranch
licenseSignozIo=${PACKAGE}/ee/query-service/constants.LicenseSignozIo
zeusURL=${PACKAGE}/ee/query-service/constants.ZeusURL

LD_FLAGS=-X ${buildHash}=${BUILD_HASH} -X ${buildTime}=${BUILD_TIME} -X ${buildVersion}=${BUILD_VERSION} -X ${gitBranch}=${BUILD_BRANCH}
LD_FLAGS=-X ${buildHash}=${BUILD_HASH} -X ${buildTime}=${BUILD_TIME} -X ${buildVersion}=${BUILD_VERSION} -X ${gitBranch}=${BUILD_BRANCH} -X ${zeusURL}=${ZEUS_URL}
DEV_LD_FLAGS=-X ${licenseSignozIo}=${DEV_LICENSE_SIGNOZ_IO}

all: build-push-frontend build-push-query-service
Expand Down
15 changes: 9 additions & 6 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ services:
condition: on-failure

query-service:
image: signoz/query-service:0.56.0
image: signoz/query-service:0.61.0
command:
[
"-config=/root/config/prometheus.yml",
"--use-logs-new-schema=true"
"--use-logs-new-schema=true",
"--use-trace-new-schema=true"
]
# ports:
# - "6060:6060" # pprof port
Expand Down Expand Up @@ -186,7 +187,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:0.56.0
image: signoz/frontend:0.61.0
deploy:
restart_policy:
condition: on-failure
Expand All @@ -199,7 +200,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector:
image: signoz/signoz-otel-collector:0.111.5
image: signoz/signoz-otel-collector:0.111.14
command:
[
"--config=/etc/otel-collector-config.yaml",
Expand Down Expand Up @@ -237,13 +238,15 @@ services:
- query-service

otel-collector-migrator:
image: signoz/signoz-schema-migrator:0.111.5
image: signoz/signoz-schema-migrator:0.111.14
deploy:
restart_policy:
condition: on-failure
delay: 5s
command:
- "--dsn=tcp://clickhouse:9000"
- "sync"
- "--dsn=tcp://clickhouse:9000"
- "--up="
depends_on:
- clickhouse
# - clickhouse-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ exporters:
clickhousetraces:
datasource: tcp://clickhouse:9000/signoz_traces
low_cardinal_exception_grouping: ${env:LOW_CARDINAL_EXCEPTION_GROUPING}
use_new_schema: true
clickhousemetricswrite:
endpoint: tcp://clickhouse:9000/signoz_metrics
resource_to_telemetry_conversion:
Expand Down
6 changes: 4 additions & 2 deletions deploy/docker/clickhouse-setup/docker-compose-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ services:
- --storage.path=/data

otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.14}
container_name: otel-migrator
command:
- "sync"
- "--dsn=tcp://clickhouse:9000"
- "--up="
depends_on:
clickhouse:
condition: service_healthy
Expand All @@ -84,7 +86,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
otel-collector:
container_name: signoz-otel-collector
image: signoz/signoz-otel-collector:0.111.5
image: signoz/signoz-otel-collector:0.111.14
command:
[
"--config=/etc/otel-collector-config.yaml",
Expand Down
3 changes: 2 additions & 1 deletion deploy/docker/clickhouse-setup/docker-compose-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ services:
command:
[
"-config=/root/config/prometheus.yml",
"--use-logs-new-schema=true"
"--use-logs-new-schema=true",
"--use-trace-new-schema=true"
]
ports:
- "6060:6060"
Expand Down
13 changes: 7 additions & 6 deletions deploy/docker/clickhouse-setup/docker-compose-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.56.0}
image: signoz/query-service:${DOCKER_TAG:-0.61.0}
container_name: signoz-query-service
command:
[
"-config=/root/config/prometheus.yml",
"--use-logs-new-schema=true"
"--use-logs-new-schema=true",
"--use-trace-new-schema=true"
]
# ports:
# - "6060:6060" # pprof port
Expand Down Expand Up @@ -201,7 +202,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.56.0}
image: signoz/frontend:${DOCKER_TAG:-0.61.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -213,7 +214,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector-migrator-sync:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.14}
container_name: otel-migrator-sync
command:
- "sync"
Expand All @@ -228,7 +229,7 @@ services:
# condition: service_healthy

otel-collector-migrator-async:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.14}
container_name: otel-migrator-async
command:
- "async"
Expand All @@ -245,7 +246,7 @@ services:
# condition: service_healthy

otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.14}
container_name: signoz-otel-collector
command:
[
Expand Down
11 changes: 6 additions & 5 deletions deploy/docker/clickhouse-setup/docker-compose.testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.56.0}
image: signoz/query-service:${DOCKER_TAG:-0.61.0}
container_name: signoz-query-service
command:
[
"-config=/root/config/prometheus.yml",
"-gateway-url=https://api.staging.signoz.cloud",
"--use-logs-new-schema=true"
"--use-logs-new-schema=true",
"--use-trace-new-schema=true"
]
# ports:
# - "6060:6060" # pprof port
Expand Down Expand Up @@ -208,7 +209,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.56.0}
image: signoz/frontend:${DOCKER_TAG:-0.61.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -220,7 +221,7 @@ services:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf

otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.14}
container_name: otel-migrator
command:
- "--dsn=tcp://clickhouse:9000"
Expand All @@ -234,7 +235,7 @@ services:


otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.5}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.14}
container_name: signoz-otel-collector
command:
[
Expand Down
1 change: 1 addition & 0 deletions deploy/docker/clickhouse-setup/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ exporters:
clickhousetraces:
datasource: tcp://clickhouse:9000/signoz_traces
low_cardinal_exception_grouping: ${env:LOW_CARDINAL_EXCEPTION_GROUPING}
use_new_schema: true
clickhousemetricswrite:
endpoint: tcp://clickhouse:9000/signoz_metrics
resource_to_telemetry_conversion:
Expand Down
2 changes: 1 addition & 1 deletion ee/query-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# use a minimal alpine image
FROM alpine:3.18.6
FROM alpine:3.20.3

# Add Maintainer Info
LABEL maintainer="signoz"
Expand Down
25 changes: 9 additions & 16 deletions ee/query-service/app/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ type APIHandlerOptions struct {
Cache cache.Cache
Gateway *httputil.ReverseProxy
// Querier Influx Interval
FluxInterval time.Duration
UseLogsNewSchema bool
UseLicensesV3 bool
FluxInterval time.Duration
UseLogsNewSchema bool
UseTraceNewSchema bool
}

type APIHandler struct {
Expand All @@ -66,7 +66,7 @@ func NewAPIHandler(opts APIHandlerOptions) (*APIHandler, error) {
Cache: opts.Cache,
FluxInterval: opts.FluxInterval,
UseLogsNewSchema: opts.UseLogsNewSchema,
UseLicensesV3: opts.UseLicensesV3,
UseTraceNewSchema: opts.UseTraceNewSchema,
})

if err != nil {
Expand Down Expand Up @@ -181,23 +181,16 @@ func (ah *APIHandler) RegisterRoutes(router *mux.Router, am *baseapp.AuthMiddlew
Methods(http.MethodGet)

// v3
router.HandleFunc("/api/v3/licenses",
am.ViewAccess(ah.listLicensesV3)).
Methods(http.MethodGet)

router.HandleFunc("/api/v3/licenses",
am.AdminAccess(ah.applyLicenseV3)).
Methods(http.MethodPost)

router.HandleFunc("/api/v3/licenses",
am.AdminAccess(ah.refreshLicensesV3)).
Methods(http.MethodPut)
router.HandleFunc("/api/v3/licenses", am.ViewAccess(ah.listLicensesV3)).Methods(http.MethodGet)
router.HandleFunc("/api/v3/licenses", am.AdminAccess(ah.applyLicenseV3)).Methods(http.MethodPost)
router.HandleFunc("/api/v3/licenses", am.AdminAccess(ah.refreshLicensesV3)).Methods(http.MethodPut)
router.HandleFunc("/api/v3/licenses/active", am.ViewAccess(ah.getActiveLicenseV3)).Methods(http.MethodGet)

// v4
router.HandleFunc("/api/v4/query_range", am.ViewAccess(ah.queryRangeV4)).Methods(http.MethodPost)

// Gateway
router.PathPrefix(gateway.RoutePrefix).HandlerFunc(am.AdminAccess(ah.ServeGatewayHTTP))
router.PathPrefix(gateway.RoutePrefix).HandlerFunc(am.EditAccess(ah.ServeGatewayHTTP))

ah.APIHandler.RegisterRoutes(router, am)

Expand Down
47 changes: 28 additions & 19 deletions ee/query-service/app/api/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (ah *APIHandler) applyLicense(w http.ResponseWriter, r *http.Request) {
RespondError(w, model.BadRequest(fmt.Errorf("license key is required")), nil)
return
}
license, apiError := ah.LM().Activate(r.Context(), l.Key)
license, apiError := ah.LM().ActivateV3(r.Context(), l.Key)
if apiError != nil {
RespondError(w, apiError, nil)
return
Expand All @@ -115,6 +115,23 @@ func (ah *APIHandler) listLicensesV3(w http.ResponseWriter, r *http.Request) {
ah.Respond(w, convertLicenseV3ToListLicenseResponse(licenses))
}

func (ah *APIHandler) getActiveLicenseV3(w http.ResponseWriter, r *http.Request) {
activeLicense, err := ah.LM().GetRepo().GetActiveLicenseV3(r.Context())
if err != nil {
RespondError(w, &model.ApiError{Typ: model.ErrorInternal, Err: err}, nil)
return
}
// return 404 not found if there is no active license
if activeLicense == nil {
RespondError(w, &model.ApiError{Typ: model.ErrorNotFound, Err: fmt.Errorf("no active license found")}, nil)
return
}

// TODO deprecate this when we move away from key for stripe
activeLicense.Data["key"] = activeLicense.Key
render.Success(w, http.StatusOK, activeLicense.Data)
}

// this function is called by zeus when inserting licenses in the query-service
func (ah *APIHandler) applyLicenseV3(w http.ResponseWriter, r *http.Request) {
var licenseKey ApplyLicenseRequest
Expand Down Expand Up @@ -218,6 +235,10 @@ func (ah *APIHandler) getBilling(w http.ResponseWriter, r *http.Request) {
func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
licensesV2 := []model.License{}
for _, l := range licenses {
planKeyFromPlanName, ok := model.MapOldPlanKeyToNewPlanName[l.PlanName]
if !ok {
planKeyFromPlanName = model.Basic
}
licenseV2 := model.License{
Key: l.Key,
ActivationId: "",
Expand All @@ -226,7 +247,7 @@ func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
ValidationMessage: "",
IsCurrent: l.IsCurrent,
LicensePlan: model.LicensePlan{
PlanKey: l.PlanName,
PlanKey: planKeyFromPlanName,
ValidFrom: l.ValidFrom,
ValidUntil: l.ValidUntil,
Status: l.Status},
Expand All @@ -237,24 +258,12 @@ func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
}

func (ah *APIHandler) listLicensesV2(w http.ResponseWriter, r *http.Request) {

var licenses []model.License

if ah.UseLicensesV3 {
licensesV3, err := ah.LM().GetLicensesV3(r.Context())
if err != nil {
RespondError(w, err, nil)
return
}
licenses = convertLicenseV3ToLicenseV2(licensesV3)
} else {
_licenses, apiError := ah.LM().GetLicenses(r.Context())
if apiError != nil {
RespondError(w, apiError, nil)
return
}
licenses = _licenses
licensesV3, apierr := ah.LM().GetLicensesV3(r.Context())
if apierr != nil {
RespondError(w, apierr, nil)
return
}
licenses := convertLicenseV3ToLicenseV2(licensesV3)

resp := model.Licenses{
TrialStart: -1,
Expand Down
3 changes: 2 additions & 1 deletion ee/query-service/app/db/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ func NewDataConnector(
dialTimeout time.Duration,
cluster string,
useLogsNewSchema bool,
useTraceNewSchema bool,
) *ClickhouseReader {
ch := basechr.NewReader(localDB, promConfigPath, lm, maxIdleConns, maxOpenConns, dialTimeout, cluster, useLogsNewSchema)
ch := basechr.NewReader(localDB, promConfigPath, lm, maxIdleConns, maxOpenConns, dialTimeout, cluster, useLogsNewSchema, useTraceNewSchema)
return &ClickhouseReader{
conn: ch.GetConn(),
appdb: localDB,
Expand Down
Loading
Loading