From b593034755c404977edbf8ea318f71a16e661e67 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 23 Jul 2025 09:18:06 -0700 Subject: [PATCH] migrate setup.sh to grafana cloud (#1528) ## Description: have otel-collector send metrics to new grafana endpoint ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I have read and accepted the CLA aggreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: evan --- setup.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index 8e9cd176b..5a515dab3 100644 --- a/setup.sh +++ b/setup.sh @@ -8,9 +8,9 @@ echo "🚀 STARTING SERVER SETUP" echo "=====================================================" # Verify required environment variables -if [ -z "$OTEL_ENDPOINT" ] || [ -z "$OTEL_USERNAME" ] || [ -z "$OTEL_PASSWORD" ]; then +if [ -z "$OTEL_EXPORTER_OTLP_ENDPOINT" ] || [ -z "$OTEL_AUTH_HEADER" ]; then echo "❌ ERROR: Required environment variables are not set!" - echo "Please set OTEL_ENDPOINT, OTEL_USERNAME, and OTEL_PASSWORD" + echo "Please set OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_AUTH_HEADER" exit 1 fi @@ -91,9 +91,6 @@ if [ ! -d "$OTEL_CONFIG_DIR" ]; then echo "Created OpenTelemetry configuration directory" fi -# Generate Base64 auth string -BASE64_AUTH=$(echo -n "${OTEL_USERNAME}:${OTEL_PASSWORD}" | base64) - # Create OpenTelemetry Collector configuration cat > "$OTEL_CONFIG_DIR/otel-collector-config.yaml" << EOF receivers: @@ -118,9 +115,9 @@ processors: exporters: otlphttp: - endpoint: "${OTEL_ENDPOINT}" + endpoint: "${OTEL_EXPORTER_OTLP_ENDPOINT}" headers: - Authorization: "Basic ${BASE64_AUTH}" + Authorization: "${OTEL_AUTH_HEADER}" tls: insecure: true # Set to false in production with proper certs @@ -154,7 +151,6 @@ echo "🚀 Starting OpenTelemetry Collector..." docker pull otel/opentelemetry-collector-contrib:latest docker rm -f otel-collector 2> /dev/null || true # Run OpenTelemetry Collector with appropriate permissions -# Run OpenTelemetry Collector echo "🚀 Starting OpenTelemetry Collector..." docker pull otel/opentelemetry-collector-contrib:latest docker rm -f otel-collector 2> /dev/null || true @@ -165,7 +161,6 @@ docker run -d \ --network=host \ --user=0 \ -v "$OTEL_CONFIG_DIR/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro" \ - -e OTEL_ENDPOINT="${OTEL_ENDPOINT}" \ otel/opentelemetry-collector-contrib:latest # Check if containers are running @@ -186,6 +181,5 @@ echo "OpenTelemetry Collector is forwarding metrics to your endpoint." echo "" echo "📝 Configuration:" echo " - Config Directory: $OTEL_CONFIG_DIR" -echo " - OpenTelemetry Endpoint: $OTEL_ENDPOINT" -echo " - Username: $OTEL_USERNAME" +echo " - OpenTelemetry Endpoint: $OTEL_EXPORTER_OTLP_ENDPOINT" echo "====================================================="