Docker Swarm
The easiest way to run SigNoz is to use SigNoz Cloud - no installation, maintenance, or scaling needed.
New users get 30 days of unlimited access to all features. Click here to sign up.
This section provides information on installing SigNoz on Docker Swarm.
Prerequisites
- A Linux or macOS machine. Microsoft Windows is not officially supported.
- Docker Engine. A minimum of 4GB of memory must be allocated to each Docker node.
- Docker Compose
- Git client
Install SigNoz on Docker Swarm
Please use non-root user (mainly for Git repository cloning), otherwise you may end up seeing file system permissions errors after the installation.
In a directory of your choosing, clone the SigNoz repository and 'cd' into the
signoz/deploy
directory by entering the following commands:git clone -b main https://github.com/SigNoz/signoz.git && cd signoz/deploy/
(Optional) If you don't have a swarm cluster in place, you can create one by entering the following command:
docker swarm init
The output should look similar as shown below:
Swarm initialized: current node (6muco3j7jjuo6k4rbiq8yr8fw) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-6ak6diq1lbrwemx17up9c1ph039h64z0dxksjxv647qnqrd290-4tt6q22dd462p4lf2n6bqbnt4 192.168.65.3:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
(Optional) You can use the
docker swarm join
command to add more nodes to the swarm. Note that the node you added in the previous step is the manager. For details, see the Docker Swarm Join page of the Docker documentation.Deploy SigNoz by entering the
docker stack deploy
command and specifying the following:-d
to deploy the stack in detached mode--prune
to remove services that are no longer referenced by the stack-c
and the path to the Swarm Compose file (docker-compose.yaml
)- The name of the stack (
signoz
)
cd deploy/docker docker stack deploy -d --prune -c docker-compose.yaml signoz
The output should look similar to the following:
Creating network signoz-net Creating service signoz_query-service Creating service signoz_frontend Creating service signoz_otel-collector Creating service signoz_schema-migrator Creating service signoz_init-clickhouse Creating service signoz_zookeeper-1 Creating service signoz_clickhouse Creating service signoz_alertmanager
(Optional) By default, the instructions in this document create three replicas, and each replica can handle 50K spans per second. To handle an increased load, perform the steps in the Scale Up section of the Operate on Docker Swarm page.
Verify the Installation
Using the
docker stack services
command, monitor the SigNoz deployment process. Wait until all SigNoz services and replicas are created:docker stack services signoz
You should see the following output:
ID NAME MODE REPLICAS IMAGE PORTS loqa6qbq7lk3 signoz_clickhouse replicated 1/1 clickhouse/clickhouse-server:24.1.2-alpine zqoee9ij9xh0 signoz_init-clickhouse replicated 0/1 clickhouse/clickhouse-server:24.1.2-alpine 9awvkhh1feov signoz_otel-collector replicated 3/3 signoz/signoz-otel-collector:0.111.24 *:4317-4318->4317-4318/tcp eu5fbg0v1bps signoz_signoz replicated 1/1 signoz/signoz:0.69.0 *:80->8080/tcp fcp7uk67tkks signoz_schema-migrator replicated 0/1 signoz/signoz-schema-migrator:0.111.24 nw6xukg1gkf7 signoz_zookeeper-1 replicated 1/1 bitnami/zookeeper:3.7.1
Set Up Infra Agent
You can set up the Infra Agent to collect logs and metrics from your infrastructure.
- Change directory to
deploy/docker-swarm/generator/infra
cd deploy/docker-swarm/generator/infra
- Deploy the Infra Agent by running the
docker stack deploy
command:
docker stack deploy -d --prune -c docker-compose.yaml signoz-infra
The output should look similar to the following:
Creating service signoz-infra_infra-logspout
Creating service signoz-infra_infra-otel-agent
- Verify that the Infra Agent is running correctly. To view the status of your containers, run the following command:
docker stack services infra
The output should look similar to the following:
ID NAME MODE REPLICAS IMAGE PORTS
k8gbgzz6u277 infra_logspout global 2/2 gliderlabs/logspout:v3.2.14
da9p8vg6ydu4 infra_otel-agent global 2/2 otel/opentelemetry-collector-contrib:0.111.0
5ja92xi7im22 infra_otel-metrics replicated 1/1 otel/opentelemetry-collector-contrib:0.111.0
- (Optional) To scrape metrics from other services using labels, you can add the following to your application's
docker-compose.yaml
file:
services:
<service-name>:
...
deploy:
labels:
signoz.io/scrape: "true"
signoz.io/port: "<port-where-metrics-are-exposed>"
signoz.io/path: "/metrics"
networks:
signoz-net:
name: signoz-net
external: true
...
- (Optional) To stop the Infra Agent, run the following command:
docker stack rm signoz-infra
By default, retention period is set to 7 days for logs and traces, and 30 days for metrics. To change this, navigate to the General tab on the Settings page of SigNoz UI.
For more details, refer to https://signoz.io/docs/userguide/retention-period.