Skip to content

Commit dd1d5fe

Browse files
authored
env updates (#1256)
1 parent 990ad42 commit dd1d5fe

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

app/.env.example

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,19 @@ SUPABASE_S3_ACCESS_KEY_ID=
4949
SUPABASE_S3_SECRET_ACCESS_KEY=
5050

5151
# ClickHouse
52-
CLICKHOUSE_HOST=YOUR_CLICKHOUSE_HOST
53-
CLICKHOUSE_PORT=8443
52+
# ClickHouse Configuration
53+
# For LOCAL development, use:
54+
# CLICKHOUSE_HOST=127.0.0.1
55+
# CLICKHOUSE_PORT=8123
56+
# CLICKHOUSE_SECURE=false
57+
# CLICKHOUSE_PASSWORD=password
58+
# For CLOUD deployment, use your ClickHouse Cloud credentials:
59+
CLICKHOUSE_HOST=127.0.0.1 # Change to YOUR_CLICKHOUSE_HOST for cloud
60+
CLICKHOUSE_PORT=8123 # Change to 8443 for cloud
5461
CLICKHOUSE_USER=default
55-
CLICKHOUSE_PASSWORD=
62+
CLICKHOUSE_PASSWORD=password # Set your password
5663
CLICKHOUSE_DATABASE=otel_2
57-
CLICKHOUSE_SECURE=true
64+
CLICKHOUSE_SECURE=false # Change to true for cloud
5865
CLICKHOUSE_ENDPOINT=
5966
CLICKHOUSE_USERNAME=
6067

app/SETUP_GUIDE.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ supabase start
8080

8181
## Step 4: Configure Environment Variables
8282

83+
Start from the example file and update for local development:
84+
85+
```bash
86+
# Copy the example file
87+
cp .env.example .env
88+
89+
# The example file now includes LOCAL settings by default
90+
# Just verify ClickHouse is set for local (not cloud):
91+
grep CLICKHOUSE .env
92+
```
93+
8394
Update `app/.env` with the following configuration.
8495

8596
**IMPORTANT**: If an `app/api/.env` file exists, you must also ensure it contains the `PROTOCOL=http` variable for local development, otherwise authentication cookies will not work properly:
@@ -219,16 +230,21 @@ supabase db dump --data-only --table=users
219230

220231
## Step 9: Start API Server
221232

222-
**IMPORTANT**: Before starting the API server, ensure the `api/.env` file exists with proper configuration. If it doesn't exist, create it:
233+
**CRITICAL**: The API requires its own `.env` file at `api/.env` with the CORRECT ClickHouse settings. If this file exists with wrong settings (e.g., pointing to cloud ClickHouse), traces won't appear even if they're stored locally.
234+
235+
**⚠️ Common Issue**: If you pulled this repo and `api/.env` already exists, it may have cloud ClickHouse settings. You MUST update it for local development:
223236

224237
```bash
225238
# Check if api/.env exists
226239
ls api/.env
227240

228-
# If it doesn't exist, create a symlink to the main .env:
241+
# Option 1: Copy from the example file (RECOMMENDED for new setup)
242+
cp api/.env.example api/.env
243+
244+
# Option 2: Create a symlink to the main .env:
229245
ln -s ../.env api/.env
230246

231-
# OR create api/.env with these minimum required variables:
247+
# Option 3: Create api/.env manually with these minimum required variables:
232248
cat > api/.env << 'EOF'
233249
PROTOCOL=http
234250
APP_DOMAIN=localhost:3000
@@ -417,6 +433,26 @@ except Exception as e:
417433

418434
## Troubleshooting
419435

436+
### Traces Not Showing in Dashboard Despite Successful Ingestion
437+
438+
If your test script says traces were sent successfully but they don't appear in the dashboard:
439+
440+
1. **Check the API's ClickHouse configuration**:
441+
```bash
442+
grep CLICKHOUSE api/.env
443+
```
444+
Should show LOCAL settings (127.0.0.1, port 8123, not cloud URLs)
445+
446+
2. **Verify traces are in ClickHouse**:
447+
```bash
448+
docker exec app-clickhouse-1 clickhouse-client --user default --password password \
449+
-q "SELECT TraceId, project_id FROM otel_2.otel_traces"
450+
```
451+
452+
3. **Ensure you're viewing the correct project**: The test data goes to "test_project", not "Default Project"
453+
454+
4. **Fix api/.env if needed** (see Step 9 above)
455+
420456
### Common Issues
421457

422458
1. **Authentication not working / Can't log in**

0 commit comments

Comments
 (0)