mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-24 02:58:44 +00:00
92 lines
3.4 KiB
Bash
92 lines
3.4 KiB
Bash
#!/usr/bin/env bash
|
|
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
|
|
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
|
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: Slaviša Arežina (tremor021)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://signoz.io/ | Github: https://github.com/SigNoz/signoz
|
|
|
|
APP="SigNoz"
|
|
var_tags="${var_tags:-notes}"
|
|
var_cpu="${var_cpu:-2}"
|
|
var_ram="${var_ram:-4096}"
|
|
var_disk="${var_disk:-20}"
|
|
var_os="${var_os:-debian}"
|
|
var_version="${var_version:-13}"
|
|
var_arm64="${var_arm64:-yes}"
|
|
var_unprivileged="${var_unprivileged:-1}"
|
|
|
|
header_info "$APP"
|
|
variables
|
|
color
|
|
catch_errors
|
|
|
|
function update_script() {
|
|
header_info
|
|
check_container_storage
|
|
check_container_resources
|
|
if [[ ! -d /opt/signoz ]]; then
|
|
msg_error "No ${APP} Installation Found!"
|
|
exit
|
|
fi
|
|
|
|
if [[ ! -f /var/lib/clickhouse/user_scripts/histogramQuantile ]]; then
|
|
fetch_and_deploy_gh_release "histogram-quantile" "SigNoz/signoz" "prebuild" "histogram-quantile/v0.0.1" "/opt/histogram-quantile" "histogram-quantile_linux_$(arch_resolve).tar.gz"
|
|
|
|
msg_info "Adding ClickHouse histogramQuantile Function"
|
|
mkdir -p /var/lib/clickhouse/user_scripts
|
|
install -m 755 -o clickhouse -g clickhouse /opt/histogram-quantile/histogram-quantile /var/lib/clickhouse/user_scripts/histogramQuantile
|
|
cat <<EOF >/etc/clickhouse-server/histogram_quantile_function.yaml
|
|
functions:
|
|
name: histogramQuantile
|
|
type: executable
|
|
format: CSV
|
|
command: ./histogramQuantile
|
|
return_type: Float64
|
|
argument:
|
|
- name: buckets
|
|
type: Array(Float64)
|
|
- name: counts
|
|
type: Array(Float64)
|
|
- name: quantile
|
|
type: Float64
|
|
EOF
|
|
systemctl restart clickhouse-server
|
|
msg_ok "Added ClickHouse histogramQuantile Function"
|
|
fi
|
|
|
|
if check_for_gh_release "signoz" "SigNoz/signoz"; then
|
|
msg_info "Stopping Services"
|
|
systemctl stop signoz
|
|
systemctl stop signoz-otel-collector
|
|
msg_ok "Stopped Services"
|
|
|
|
fetch_and_deploy_gh_release "signoz" "SigNoz/signoz" "prebuild" "latest" "/opt/signoz" "signoz-community_linux_$(arch_resolve).tar.gz"
|
|
fetch_and_deploy_gh_release "signoz-otel-collector" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-otel-collector" "signoz-otel-collector_linux_$(arch_resolve).tar.gz"
|
|
fetch_and_deploy_gh_release "signoz-schema-migrator" "SigNoz/signoz-otel-collector" "prebuild" "latest" "/opt/signoz-schema-migrator" "signoz-schema-migrator_linux_$(arch_resolve).tar.gz"
|
|
|
|
msg_info "Updating SigNoz"
|
|
cd /opt/signoz-schema-migrator/bin
|
|
$STD ./signoz-schema-migrator sync --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
|
$STD ./signoz-schema-migrator async --dsn="tcp://localhost:9000?password=" --replication=true --up=
|
|
msg_ok "Updated SigNoz"
|
|
|
|
msg_info "Starting Services"
|
|
systemctl start signoz-otel-collector
|
|
systemctl start signoz
|
|
msg_ok "Started Services"
|
|
msg_ok "Updated successfully!"
|
|
fi
|
|
exit
|
|
}
|
|
|
|
start
|
|
build_container
|
|
description
|
|
|
|
msg_ok "Completed successfully!\n"
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
|
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
|
echo -e "${GATEWAY}${BGN}http://${IP}:8080${CL}"
|