Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/examples/systemd/binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ sudo chown -R signoz:signoz /opt/signoz /var/lib/signoz /opt/ingester /var/lib/i

The `signoz` user must also have traverse permissions to the `pours/` output directory.

## Download SigNoz

Download the SigNoz release tarball and extract it into `/opt/signoz`:

```bash
ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
sudo mkdir -p /opt/signoz
curl -fsSL "https://github.com/SigNoz/signoz/releases/latest/download/signoz_linux_${ARCH}.tar.gz" \
| sudo tar -xz --strip-components=1 -C /opt/signoz
```

> [!IMPORTANT]
> Extract the full tarball, do not move the `signoz` binary on its own. SigNoz resolves
> the web frontend and notification templates relative to the binary, so `bin/`, `web/`,
> `templates/`, and `conf/` must stay together under `/opt/signoz`. Moving only the binary
> leaves the UI and alert/email templates unresolved.

## Configuration

```yaml
Expand Down
6 changes: 6 additions & 0 deletions docs/examples/systemd/binary/casting.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,13 @@ spec:
config: {}
enabled: true
env:
SIGNOZ_ALERTMANAGER_SIGNOZ_TEMPLATES: /opt/signoz/templates/alertmanager/*.gotmpl
SIGNOZ_EMAILING_TEMPLATES_DIRECTORY: /opt/signoz/templates/email
SIGNOZ_SQLSTORE_POSTGRES_DSN: postgres://signoz:signoz@localhost:5432/signoz?sslmode=disable
SIGNOZ_SQLSTORE_PROVIDER: postgres
SIGNOZ_TELEMETRYSTORE_CLICKHOUSE_DSN: tcp://localhost:9000
SIGNOZ_TELEMETRYSTORE_PROVIDER: clickhouse
SIGNOZ_WEB_DIRECTORY: /opt/signoz/web
image: signoz/signoz:latest
version: latest
status:
Expand All @@ -342,10 +345,13 @@ spec:
- ws://localhost:4320
config: {}
env:
SIGNOZ_ALERTMANAGER_SIGNOZ_TEMPLATES: /opt/signoz/templates/alertmanager/*.gotmpl
SIGNOZ_EMAILING_TEMPLATES_DIRECTORY: /opt/signoz/templates/email
SIGNOZ_SQLSTORE_POSTGRES_DSN: postgres://signoz:signoz@localhost:5432/signoz?sslmode=disable
SIGNOZ_SQLSTORE_PROVIDER: postgres
SIGNOZ_TELEMETRYSTORE_CLICKHOUSE_DSN: tcp://localhost:9000
SIGNOZ_TELEMETRYSTORE_PROVIDER: clickhouse
SIGNOZ_WEB_DIRECTORY: /opt/signoz/web
telemetrykeeper:
kind: clickhousekeeper
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
WantedBy=multi-user.target

[Service]
Environment=SIGNOZ_WEB_DIRECTORY=/opt/signoz/web
Environment=SIGNOZ_ALERTMANAGER_SIGNOZ_TEMPLATES=/opt/signoz/templates/alertmanager/*.gotmpl
Environment=SIGNOZ_EMAILING_TEMPLATES_DIRECTORY=/opt/signoz/templates/email
Environment=SIGNOZ_SQLSTORE_POSTGRES_DSN=postgres://signoz:signoz@localhost:5432/signoz?sslmode=disable
Environment=SIGNOZ_SQLSTORE_PROVIDER=postgres
Environment=SIGNOZ_TELEMETRYSTORE_CLICKHOUSE_DSN=tcp://localhost:9000
Environment=SIGNOZ_TELEMETRYSTORE_PROVIDER=clickhouse
Environment=SIGNOZ_WEB_DIRECTORY=/opt/signoz/web
ExecStart=/opt/signoz/bin/signoz server
Group=signoz
KillMode=mixed
Expand Down
12 changes: 12 additions & 0 deletions internal/casting/systemdcasting/enricher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package systemdcasting

import (
"context"
"path"

"github.com/signoz/foundry/api/v1alpha1"
"github.com/signoz/foundry/api/v1alpha1/installation"
Expand Down Expand Up @@ -142,6 +143,17 @@ func (e *linuxMoldingEnricher) enrichSignoz(config *installation.Casting) error
config.Metadata.Annotations["foundry.signoz.io/signoz-binary-path"] = signozBin
}

// The binary defaults these to its in-container paths, so point them at the
// extracted tarball tree (binary lives at <root>/bin/signoz).
root := path.Dir(path.Dir(signozBin))
if config.Spec.Signoz.Status.Env == nil {
config.Spec.Signoz.Status.Env = make(map[string]string)
}
env := config.Spec.Signoz.Status.Env
env["SIGNOZ_WEB_DIRECTORY"] = path.Join(root, "web")
env["SIGNOZ_EMAILING_TEMPLATES_DIRECTORY"] = path.Join(root, "templates", "email")
env["SIGNOZ_ALERTMANAGER_SIGNOZ_TEMPLATES"] = path.Join(root, "templates", "alertmanager", "*.gotmpl")

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ WorkingDirectory=/opt/signoz
{{- $signozBinaryPath := index $.Metadata.Annotations "foundry.signoz.io/signoz-binary-path" }}
ExecStart={{ $signozBinaryPath }} server
{{- end }}
Environment=SIGNOZ_WEB_DIRECTORY=/opt/signoz/web
{{- range $key, $value := $.Spec.Signoz.Spec.Env }}
Environment={{ $key }}={{ $value }}
{{- end }}
Expand Down
Loading