diff --git a/blueprints/signoz/docker-compose.yml b/blueprints/signoz/docker-compose.yml index a8a70329..aaa6921a 100644 --- a/blueprints/signoz/docker-compose.yml +++ b/blueprints/signoz/docker-compose.yml @@ -1,186 +1,168 @@ +x-common: &common + networks: + - signoz-net + restart: unless-stopped + logging: + options: + max-size: 50m + max-file: "3" +x-clickhouse-defaults: &clickhouse-defaults + !!merge <<: *common + image: clickhouse/clickhouse-server:25.5.6 + tty: true + labels: + signoz.io/scrape: "true" + signoz.io/port: "9363" + signoz.io/path: "/metrics" + depends_on: + init-clickhouse: + condition: service_completed_successfully + zookeeper-1: + condition: service_healthy + healthcheck: + test: + - CMD + - wget + - --spider + - -q + - 0.0.0.0:8123/ping + interval: 30s + timeout: 5s + retries: 3 + ulimits: + nproc: 65535 + nofile: + soft: 262144 + hard: 262144 + environment: + - CLICKHOUSE_SKIP_USER_SETUP=1 +x-zookeeper-defaults: &zookeeper-defaults + !!merge <<: *common + image: signoz/zookeeper:3.7.1 + user: root + labels: + signoz.io/scrape: "true" + signoz.io/port: "9141" + signoz.io/path: "/metrics" + healthcheck: + test: + - CMD-SHELL + - curl -s -m 2 http://localhost:8080/commands/ruok | grep error | grep null + interval: 30s + timeout: 5s + retries: 3 +x-db-depend: &db-depend + !!merge <<: *common + depends_on: + clickhouse: + condition: service_healthy + schema-migrator-sync: + condition: service_completed_successfully services: - otel-conf: - image: alpine:3.20 + init-clickhouse: + !!merge <<: *common + image: clickhouse/clickhouse-server:25.5.6 command: - - /bin/sh - - -lc + - bash + - -c - | - cat > /otel/config.yaml <<'YAML' - receivers: - otlp: - protocols: - grpc: - endpoint: 0.0.0.0:4317 - http: - endpoint: 0.0.0.0:4318 - - processors: - batch: - - exporters: - clickhousetraces: - datasource: tcp://clickhouse:9000/signoz_traces - use_new_schema: true - - clickhousemetricswrite: - endpoint: tcp://clickhouse:9000/signoz_metrics - timeout: 15s - resource_to_telemetry_conversion: - enabled: true - - clickhouselogsexporter: - dsn: tcp://clickhouse:9000/signoz_logs - timeout: 10s - use_new_schema: true - - metadataexporter: - dsn: tcp://clickhouse:9000/signoz_metadata - timeout: 10s - - service: - pipelines: - traces: - receivers: [otlp] - processors: [batch] - exporters: [clickhousetraces, metadataexporter] - metrics: - receivers: [otlp] - processors: [batch] - exporters: [clickhousemetricswrite, metadataexporter] - logs: - receivers: [otlp] - processors: [batch] - exporters: [clickhouselogsexporter, metadataexporter] - YAML + version="v0.0.1" + node_os=$$(uname -s | tr '[:upper:]' '[:lower:]') + node_arch=$$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) + echo "Fetching histogram-binary for $${node_os}/$${node_arch}" + cd /tmp + wget -O histogram-quantile.tar.gz "https://github.com/SigNoz/signoz/releases/download/histogram-quantile%2F$${version}/histogram-quantile_$${node_os}_$${node_arch}.tar.gz" + tar -xvzf histogram-quantile.tar.gz + mv histogram-quantile /var/lib/clickhouse/user_scripts/histogramQuantile + restart: on-failure volumes: - - otel-config:/otel - restart: "no" - - ch-conf: - image: alpine:3.20 - command: - - /bin/sh - - -lc - - | - cat > /config/cluster.xml <<'XML' - - - - - - - clickhouse - 9000 - - - - - - - zookeeper-1 - 2181 - - - - /clickhouse/task_queue/ddl - - - XML - volumes: - - ch-config:/config - restart: "no" - + - ../files/clickhouse/user_scripts:/var/lib/clickhouse/user_scripts/ zookeeper-1: - image: bitnami/zookeeper:3.9 - restart: unless-stopped + !!merge <<: *zookeeper-defaults + volumes: + - zookeeper-1:/bitnami/zookeeper environment: + - ZOO_SERVER_ID=1 - ALLOW_ANONYMOUS_LOGIN=yes - - ZOO_4LW_COMMANDS_WHITELIST=ruok,stat,envi,conf,mntr - healthcheck: - test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep imok"] - interval: 30s - timeout: 5s - retries: 3 - volumes: - - zookeeper-data:/bitnami/zookeeper - + - ZOO_AUTOPURGE_INTERVAL=1 + - ZOO_ENABLE_PROMETHEUS_METRICS=yes + - ZOO_PROMETHEUS_METRICS_PORT_NUMBER=9141 clickhouse: - image: clickhouse/clickhouse-server:24.1.2-alpine - restart: unless-stopped - depends_on: - ch-conf: - condition: service_completed_successfully - ulimits: - nproc: 65535 - nofile: - soft: 262144 - hard: 262144 - healthcheck: - test: ["CMD","wget","--spider","-q","0.0.0.0:8123/ping"] - interval: 30s - timeout: 5s - retries: 3 + !!merge <<: *clickhouse-defaults + container_name: signoz-clickhouse volumes: - - clickhouse-data:/var/lib/clickhouse - - ch-config:/etc/clickhouse-server/config.d - - schema-migrator-sync: - image: signoz/signoz-schema-migrator:v0.129.0 - command: ["sync","--dsn=tcp://clickhouse:9000","--cluster-name=cluster","--up="] - depends_on: - clickhouse: - condition: service_healthy - restart: "no" - - schema-migrator-async: - image: signoz/signoz-schema-migrator:v0.129.0 - command: ["async","--dsn=tcp://clickhouse:9000","--cluster-name=cluster","--up="] - depends_on: - clickhouse: - condition: service_healthy - schema-migrator-sync: - condition: service_completed_successfully - restart: unless-stopped - + - ../files/clickhouse/config.xml:/etc/clickhouse-server/config.xml + - ../files/clickhouse/user_scripts:/var/lib/clickhouse/user_scripts/ + - ../files/clickhouse/cluster.xml:/etc/clickhouse-server/config.d/cluster.xml + - clickhouse:/var/lib/clickhouse/ signoz: - image: signoz/signoz:v0.92.1 - depends_on: - clickhouse: - condition: service_healthy - schema-migrator-sync: - condition: service_completed_successfully + !!merge <<: *db-depend + image: signoz/signoz:v0.97.1 + command: + - --config=/root/config/prometheus.yml + ports: + - "8080" + volumes: + - ../files/signoz/prometheus.yml:/root/config/prometheus.yml + - sqlite:/var/lib/signoz/ environment: - SIGNOZ_ALERTMANAGER_PROVIDER=signoz - - STORAGE=clickhouse - SIGNOZ_TELEMETRYSTORE_CLICKHOUSE_DSN=tcp://clickhouse:9000 - - SIGNOZ_ANALYTICS_ENABLED=false + - SIGNOZ_SQLSTORE_SQLITE_PATH=/var/lib/signoz/signoz.db + - STORAGE=clickhouse + - TELEMETRY_ENABLED=true + - DEPLOYMENT_TYPE=docker-standalone-amd + - DOT_METRICS_ENABLED=true - SIGNOZ_JWT_SECRET=${SIGNOZ_JWT_SECRET} - ports: - - 8080 - restart: unless-stopped + healthcheck: + test: + - CMD + - wget + - --spider + - -q + - localhost:8080/api/v1/health + interval: 30s + timeout: 5s + retries: 3 + otel-collector: + !!merge <<: *db-depend + image: signoz/signoz-otel-collector:v0.129.7 + command: + - --config=/etc/otel-collector-config.yaml volumes: - - signoz-data:/var/lib/signoz - - signoz-otel-collector: - image: signoz/signoz-otel-collector:v0.129.0 + - ../files/collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "4317" # OTLP gRPC receiver + - "4318" # OTLP HTTP receiver + depends_on: + signoz: + condition: service_healthy + schema-migrator-sync: + !!merge <<: *common + image: signoz/signoz-schema-migrator:v0.129.7 + command: + - sync + - --dsn=tcp://clickhouse:9000 + - --up= depends_on: clickhouse: condition: service_healthy - otel-conf: - condition: service_completed_successfully - schema-migrator-sync: - condition: service_completed_successfully - command: ["--config=/etc/otelcol/config.yaml"] - volumes: - - otel-config:/etc/otelcol:ro - ports: - - 4317 - - 4318 - restart: unless-stopped - + restart: on-failure + schema-migrator-async: + !!merge <<: *db-depend + image: signoz/signoz-schema-migrator:v0.129.7 + command: + - async + - --dsn=tcp://clickhouse:9000 + - --up= + restart: on-failure +networks: + signoz-net: + name: signoz-net volumes: - clickhouse-data: - ch-config: - zookeeper-data: - signoz-data: - otel-config: \ No newline at end of file + clickhouse: + name: signoz-clickhouse + sqlite: + name: signoz-sqlite + zookeeper-1: + name: signoz-zookeeper-1 diff --git a/blueprints/signoz/template.toml b/blueprints/signoz/template.toml index 27cd9581..492a613a 100644 --- a/blueprints/signoz/template.toml +++ b/blueprints/signoz/template.toml @@ -9,5 +9,1314 @@ port = 8080 host = "${main_domain}" path = "/" +[[config.domains]] +serviceName = "otel-collector" +port = 4318 +host = "${main_domain}" +path = "/" + [config.env] SIGNOZ_JWT_SECRET = "${jwt_secret}" + +[[config.mounts]] +filePath = "/clickhouse/config.xml" +content = """ + + + + + + information + + json + + /var/log/clickhouse-server/clickhouse-server.log + /var/log/clickhouse-server/clickhouse-server.err.log + + 1000M + 10 + + + + + + + + + + + + + + + + + + 8123 + + + 9000 + + + 9004 + + + 9005 + + + + + + + + + + + + 9009 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4096 + + + 3 + + + + + false + + + /path/to/ssl_cert_file + /path/to/ssl_key_file + + + false + + + /path/to/ssl_ca_cert_file + + + none + + + 0 + + + -1 + -1 + + + false + + + + + + + + + + + none + true + true + sslv2,sslv3 + true + + + + true + true + sslv2,sslv3 + true + + + + RejectCertificateHandler + + + + + + + + + 100 + + + 0 + + + + 10000 + + + + + + 0.9 + + + 4194304 + + + 0 + + + + + + 8589934592 + + + 5368709120 + + + + 1000 + + + 134217728 + + + 10000 + + + /var/lib/clickhouse/ + + + /var/lib/clickhouse/tmp/ + + + + ` + + + + + + /var/lib/clickhouse/user_files/ + + + + + + + + + + + + + users.xml + + + + /var/lib/clickhouse/access/ + + + + + + + default + + + + + + + + + + + + default + + + + + + + + + true + + + false + + ' | sed -e 's|.*>\(.*\)<.*|\1|') + wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge_$PKG_VER-1_all.deb + apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$PKG_VER-1_all.deb + clickhouse-jdbc-bridge & + + * [CentOS/RHEL] + export MVN_URL=https://repo1.maven.org/maven2/ru/yandex/clickhouse/clickhouse-jdbc-bridge + export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '' | sed -e 's|.*>\(.*\)<.*|\1|') + wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm + yum localinstall -y clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm + clickhouse-jdbc-bridge & + + Please refer to https://github.com/ClickHouse/clickhouse-jdbc-bridge#usage for more information. + ]]> + + + + + + + + + + + + + + + 01 + example01-01-1 + + + + + + 3600 + + + + 3600 + + + 60 + + + + + + + + + + /metrics + 9363 + + true + true + true + true + + + + + + system + query_log
+ + toYYYYMM(event_date) + + + + + + 7500 +
+ + + + system + trace_log
+ + toYYYYMM(event_date) + 7500 +
+ + + + system + query_thread_log
+ toYYYYMM(event_date) + 7500 +
+ + + + system + query_views_log
+ toYYYYMM(event_date) + 7500 +
+ + + + system + part_log
+ toYYYYMM(event_date) + 7500 +
+ + + + + + system + metric_log
+ 7500 + 1000 +
+ + + + system + asynchronous_metric_log
+ + 7000 +
+ + + + + + engine MergeTree + partition by toYYYYMM(finish_date) + order by (finish_date, finish_time_us, trace_id) + + system + opentelemetry_span_log
+ 7500 +
+ + + + + system + crash_log
+ + + 1000 +
+ + + + + + + system + processors_profile_log
+ + toYYYYMM(event_date) + 7500 +
+ + + + + + + + + *_dictionary.xml + + + *function.xml + /var/lib/clickhouse/user_scripts/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /clickhouse/task_queue/ddl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + click_cost + any + + 0 + 3600 + + + 86400 + 60 + + + + max + + 0 + 60 + + + 3600 + 300 + + + 86400 + 3600 + + + + + + /var/lib/clickhouse/format_schemas/ + + + + + hide encrypt/decrypt arguments + ((?:aes_)?(?:encrypt|decrypt)(?:_mysql)?)\s*\(\s*(?:'(?:\\'|.)+'|.*?)\s*\) + + \1(???) + + + + + + + + + + false + + false + + + https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277 + + + + + + + + + + + 268435456 + true + +
+""" + +[[config.mounts]] +filePath = "/clickhouse/cluster.xml" +content = """ + + + + + + zookeeper-1 + 2181 + + + + + + + + + + + + + + + + clickhouse + 9000 + + + + + + + + +""" + +[[config.mounts]] +filePath = "/signoz/prometheus.xml" +content = """ +# my global config +global: + scrape_interval: 5s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: [] + # - "first_rules.yml" + # - "second_rules.yml" + # - 'alerts.yml' + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: [] + +remote_read: + - url: tcp://clickhouse:9000/signoz_metrics +""" + +[[config.mounts]] +filePath = "/collector/otel-collector-config.yaml" +content = """ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 +processors: + batch: +exporters: + clickhousetraces: + datasource: tcp://clickhouse:9000/signoz_traces + use_new_schema: true + signozclickhousemetrics: + dsn: tcp://clickhouse:9000/signoz_metrics + timeout: 15s + clickhouselogsexporter: + dsn: tcp://clickhouse:9000/signoz_logs + timeout: 10s + use_new_schema: true + metadataexporter: + dsn: tcp://clickhouse:9000/signoz_metadata + timeout: 10s +service: + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [clickhousetraces, metadataexporter] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [signozclickhousemetrics, metadataexporter] + logs: + receivers: [otlp] + processors: [batch] + exporters: [clickhouselogsexporter, metadataexporter] +""" + +[[config.mounts]] +filePath = "/clickhouse/user_scripts/empty.txt" +content = "" \ No newline at end of file diff --git a/meta.json b/meta.json index 513b260c..0502bbca 100644 --- a/meta.json +++ b/meta.json @@ -4741,7 +4741,7 @@ { "id": "signoz", "name": "SigNoz", - "version": "v0.92.1", + "version": "v0.97.1", "description": "SigNoz is an open-source Datadog or New Relic alternative. Get APM, logs,traces, metrics, exceptions, & alerts in a single tool.", "logo": "signoz.svg", "links": {