Skip to content

Commit

Permalink
Merge branch 'main' into query-service-waterfall
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored Jan 4, 2025
2 parents 04a0c75 + 4967696 commit efa9b5a
Show file tree
Hide file tree
Showing 48 changed files with 2,458 additions and 232 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/prereleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: prereleaser

on:
# schedule every wednesday 9:30 AM UTC (3pm IST)
schedule:
- cron: '30 9 * * 3'

# allow manual triggering of the workflow by a maintainer
workflow_dispatch:
inputs:
release_type:
description: "Type of the release"
type: choice
required: true
options:
- 'patch'
- 'minor'
- 'major'

jobs:
signoz:
uses: signoz/primus.workflows/.github/workflows/releaser.yaml@main
secrets: inherit
with:
PRIMUS_REF: main
PROJECT_NAME: signoz
RELEASE_TYPE: ${{ inputs.release_type || 'minor' }}
45 changes: 34 additions & 11 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
name: releaser

on:
# schedule every wednesday 9:30 AM UTC (3pm IST)
schedule:
- cron: '30 9 * * 3'

# allow manual triggering of the workflow by a maintainer with no inputs
workflow_dispatch: {}
# trigger on new latest release
release:
types: [published]

jobs:
releaser:
uses: signoz/primus.workflows/.github/workflows/releaser-signoz.yaml@main
secrets: inherit
with:
PRIMUS_REF: main
charts:
runs-on: ubuntu-latest
steps:
- id: token
name: github-token-gen
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PRIMUS_APP_ID }}
private-key: ${{ secrets.PRIMUS_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: trigger-charts-prereleaser
run: |
# Variables
repo_owner="signoz"
repo_name="charts"
event_type="prereleaser"
# identify the release type
release_tag=${{ github.event.release.tag_name }}
patch_number=$(echo $release_tag | awk -F. '{print $3}')
release_type="minor"
if [[ $patch_number -ne 0 ]]; then
release_type="patch"
fi
# trigger the releaser workflow in signoz/charts repo
curl -L -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ steps.token.outputs.token }}" \
"https://api.github.com/repos/${repo_owner}/${repo_name}/dispatches" \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"release_type\": \"$release_type\"}}"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ check-no-ee-references:
fi

test:
go test ./pkg/query-service/...
go test ./pkg/...
23 changes: 22 additions & 1 deletion conf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,25 @@ web:
# The prefix to serve web on
prefix: /
# The directory containing the static build files.
directory: /etc/signoz/web
directory: /etc/signoz/web

##################### Cache #####################
cache:
# specifies the caching provider to use.
provider: memory
# memory: Uses in-memory caching.
memory:
# Time-to-live for cache entries in memory. Specify the duration in ns
ttl: 60000000000
# The interval at which the cache will be cleaned up
cleanupInterval:
# redis: Uses Redis as the caching backend.
redis:
# The hostname or IP address of the Redis server.
host: localhost
# The port on which the Redis server is running. Default is usually 6379.
port: 6379
# The password for authenticating with the Redis server, if required.
password:
# The Redis database number to use
db: 0
8 changes: 4 additions & 4 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ services:
restart_policy:
condition: on-failure
query-service:
image: signoz/query-service:0.65.0
image: signoz/query-service:0.66.0
command: ["-config=/root/config/prometheus.yml", "--use-logs-new-schema=true", "--use-trace-new-schema=true"]
# ports:
# - "6060:6060" # pprof port
Expand Down Expand Up @@ -158,7 +158,7 @@ services:
condition: on-failure
!!merge <<: *db-depend
frontend:
image: signoz/frontend:0.65.0
image: signoz/frontend:0.66.0
deploy:
restart_policy:
condition: on-failure
Expand All @@ -170,7 +170,7 @@ services:
volumes:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
otel-collector:
image: signoz/signoz-otel-collector:0.111.16
image: signoz/signoz-otel-collector:0.111.21
command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
user: root # required for reading docker container logs
volumes:
Expand Down Expand Up @@ -202,7 +202,7 @@ services:
- otel-collector-migrator
- query-service
otel-collector-migrator:
image: signoz/signoz-schema-migrator:0.111.16
image: signoz/signoz-schema-migrator:0.111.21
deploy:
restart_policy:
condition: on-failure
Expand Down
40 changes: 10 additions & 30 deletions deploy/docker/clickhouse-setup/docker-compose-core.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "2.4"

include:
- test-app-docker-compose.yaml

services:
zookeeper-1:
image: bitnami/zookeeper:3.7.1
Expand All @@ -20,7 +18,6 @@ services:
# - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-2:2888:3888,zookeeper-3:2888:3888
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_AUTOPURGE_INTERVAL=1

clickhouse:
image: clickhouse/clickhouse-server:24.1.2-alpine
container_name: signoz-clickhouse
Expand All @@ -43,18 +40,10 @@ services:
max-file: "3"
healthcheck:
# "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'"
test:
[
"CMD",
"wget",
"--spider",
"-q",
"0.0.0.0:8123/ping"
]
test: ["CMD", "wget", "--spider", "-q", "0.0.0.0:8123/ping"]
interval: 30s
timeout: 5s
retries: 3

alertmanager:
container_name: signoz-alertmanager
image: signoz/alertmanager:0.23.7
Expand All @@ -67,33 +56,25 @@ services:
command:
- --queryService.url=http://query-service:8085
- --storage.path=/data

otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.21}
container_name: otel-migrator
command:
- "sync"
- "sync"
- "--dsn=tcp://clickhouse:9000"
- "--up="
- "--up="
depends_on:
clickhouse:
condition: service_healthy
# clickhouse-2:
# condition: service_healthy
# clickhouse-3:
# condition: service_healthy

# clickhouse-2:
# condition: service_healthy
# clickhouse-3:
# condition: service_healthy
# 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.16
command:
[
"--config=/etc/otel-collector-config.yaml",
"--manager-config=/etc/manager-config.yaml",
"--copy-path=/var/tmp/collector-config.yaml",
"--feature-gates=-pkg.translator.prometheus.NormalizeName"
]
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.21}
command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--copy-path=/var/tmp/collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
# user: root # required for reading docker container logs
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
Expand Down Expand Up @@ -122,7 +103,6 @@ services:
condition: service_completed_successfully
query-service:
condition: service_healthy

logspout:
image: "gliderlabs/logspout:v3.2.14"
container_name: signoz-logspout
Expand Down
10 changes: 5 additions & 5 deletions deploy/docker/clickhouse-setup/docker-compose-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ services:
- --storage.path=/data
# 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.65.0}
image: signoz/query-service:${DOCKER_TAG:-0.66.0}
container_name: signoz-query-service
command: ["-config=/root/config/prometheus.yml", "--use-logs-new-schema=true", "--use-trace-new-schema=true"]
# ports:
Expand All @@ -172,7 +172,7 @@ services:
retries: 3
!!merge <<: *db-depend
frontend:
image: signoz/frontend:${DOCKER_TAG:-0.65.0}
image: signoz/frontend:${DOCKER_TAG:-0.66.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -183,7 +183,7 @@ services:
volumes:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
otel-collector-migrator-sync:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.21}
container_name: otel-migrator-sync
command:
- "sync"
Expand All @@ -197,7 +197,7 @@ services:
# clickhouse-3:
# condition: service_healthy
otel-collector-migrator-async:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.21}
container_name: otel-migrator-async
command:
- "async"
Expand All @@ -213,7 +213,7 @@ services:
# clickhouse-3:
# condition: service_healthy
otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.21}
container_name: signoz-otel-collector
command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--copy-path=/var/tmp/collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
user: root # required for reading docker container logs
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker/clickhouse-setup/docker-compose.testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ services:
- --storage.path=/data
# 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.65.0}
image: signoz/query-service:${DOCKER_TAG:-0.66.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-trace-new-schema=true"]
# ports:
Expand Down Expand Up @@ -176,7 +176,7 @@ services:
retries: 3
!!merge <<: *db-depend
frontend:
image: signoz/frontend:${DOCKER_TAG:-0.65.0}
image: signoz/frontend:${DOCKER_TAG:-0.66.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand All @@ -187,7 +187,7 @@ services:
volumes:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
otel-collector-migrator:
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.21}
container_name: otel-migrator
command:
- "--dsn=tcp://clickhouse:9000"
Expand All @@ -199,7 +199,7 @@ services:
# clickhouse-3:
# condition: service_healthy
otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.16}
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.21}
container_name: signoz-otel-collector
command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--copy-path=/var/tmp/collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"]
user: root # required for reading docker container logs
Expand Down
15 changes: 10 additions & 5 deletions ee/query-service/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
baseauth "go.signoz.io/signoz/pkg/query-service/auth"
"go.signoz.io/signoz/pkg/query-service/migrate"
v3 "go.signoz.io/signoz/pkg/query-service/model/v3"
"go.signoz.io/signoz/pkg/signoz"
"go.signoz.io/signoz/pkg/web"

licensepkg "go.signoz.io/signoz/ee/query-service/license"
Expand Down Expand Up @@ -62,6 +63,7 @@ import (
const AppDbEngine = "sqlite"

type ServerOptions struct {
SigNoz *signoz.SigNoz
PromConfigPath string
SkipTopLvlOpsPath string
HTTPHostPort string
Expand All @@ -79,6 +81,7 @@ type ServerOptions struct {
GatewayUrl string
UseLogsNewSchema bool
UseTraceNewSchema bool
SkipWebFrontend bool
}

// Server runs HTTP api service
Expand Down Expand Up @@ -108,7 +111,7 @@ func (s Server) HealthCheckStatus() chan healthcheck.Status {
}

// NewServer creates and initializes Server
func NewServer(serverOptions *ServerOptions, web *web.Web) (*Server, error) {
func NewServer(serverOptions *ServerOptions) (*Server, error) {

modelDao, err := dao.InitDao("sqlite", baseconst.RELATIONAL_DATASOURCE_PATH)
if err != nil {
Expand Down Expand Up @@ -292,7 +295,7 @@ func NewServer(serverOptions *ServerOptions, web *web.Web) (*Server, error) {
usageManager: usageManager,
}

httpServer, err := s.createPublicServer(apiHandler, web)
httpServer, err := s.createPublicServer(apiHandler, serverOptions.SigNoz.Web)

if err != nil {
return nil, err
Expand Down Expand Up @@ -385,9 +388,11 @@ func (s *Server) createPublicServer(apiHandler *api.APIHandler, web *web.Web) (*

handler = handlers.CompressHandler(handler)

err := web.AddToRouter(r)
if err != nil {
return nil, err
if !s.serverOptions.SkipWebFrontend {
err := web.AddToRouter(r)
if err != nil {
return nil, err
}
}

return &http.Server{
Expand Down
Loading

0 comments on commit efa9b5a

Please sign in to comment.