Skip to content

Commit

Permalink
Production deployment (#1100)
Browse files Browse the repository at this point in the history
**Only merge using a merge commit!**
  • Loading branch information
simonknittel authored Jan 25, 2025
2 parents 50e4b13 + 346ae9a commit 6797b37
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 17 deletions.
9 changes: 0 additions & 9 deletions app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ NEXT_PUBLIC_R2_PUBLIC_URL=""
UNLEASH_SERVER_API_URL=""
UNLEASH_SERVER_API_TOKEN=""

# Loki
# LOKI_HOST=""
# LOKI_AUTH_USER=""
# LOKI_AUTH_PASSWORD=""

# Other
NEXT_PUBLIC_CARE_BEAR_SHOOTER_BUILD_URL=""
OPENAI_API_KEY=""
Expand All @@ -47,7 +42,3 @@ AWS_EVENT_BUS_ARN="" # AWS_PROFILE=sinister-incorporated-test terraform output e
API_CLIENT_KEY="" # Copy contents from `/certificates/localhost.key` and join lines using `\n`
API_CLIENT_CERT="" # Copy contents from `/certificates/localhost.pem` and join lines using `\n`
EMAIL_FUNCTION_ENDPOINT=""

# Pusher
PUSHER_BEAMS_INSTANCE_ID=""
PUSHER_BEAMS_KEY=""
172 changes: 164 additions & 8 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"@aws-sdk/client-s3": "3.726.1",
"@aws-sdk/s3-request-presigner": "3.726.1",
"@next-auth/prisma-adapter": "1.0.7",
"@opentelemetry/api-logs": "0.57.1",
"@opentelemetry/instrumentation": "0.57.1",
"@opentelemetry/sdk-logs": "0.57.1",
"@paralleldrive/cuid2": "2.2.2",
"@prisma/client": "6.2.1",
"@pusher/push-notifications-server": "1.2.7",
Expand All @@ -40,6 +43,7 @@
"@trpc/server": "11.0.0-rc.700",
"@unleash/nextjs": "1.5.0",
"@vercel/analytics": "1.4.1",
"@vercel/otel": "1.10.1",
"@vercel/speed-insights": "1.1.0",
"@xyflow/react": "12.3.6",
"algoliasearch": "4.24.0",
Expand Down
6 changes: 6 additions & 0 deletions app/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export const env = createEnv({
CRON_SECRET: z.string().optional(),
PUSHER_BEAMS_INSTANCE_ID: z.string().optional(),
PUSHER_BEAMS_KEY: z.string().optional(),
ENABLE_INSTRUMENTATION: z.string().optional(),
OTEL_EXPORTER_OTLP_PROTOCOL: z.string().optional(),
OTEL_EXPORTER_OTLP_ENDPOINT: z.string().optional(),
},

/*
Expand Down Expand Up @@ -133,6 +136,9 @@ export const env = createEnv({
CRON_SECRET: process.env.CRON_SECRET,
PUSHER_BEAMS_INSTANCE_ID: process.env.PUSHER_BEAMS_INSTANCE_ID,
PUSHER_BEAMS_KEY: process.env.PUSHER_BEAMS_KEY,
ENABLE_INSTRUMENTATION: process.env.ENABLE_INSTRUMENTATION,
OTEL_EXPORTER_OTLP_PROTOCOL: process.env.OTEL_EXPORTER_OTLP_PROTOCOL,
OTEL_EXPORTER_OTLP_ENDPOINT: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
},

emptyStringAsUndefined: true,
Expand Down
9 changes: 9 additions & 0 deletions app/src/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { registerOTel } from "@vercel/otel";
import { env } from "./env";

export const register = () => {
if (env.ENABLE_INSTRUMENTATION !== "true") return;
if (!env.OTEL_EXPORTER_OTLP_PROTOCOL || !env.OTEL_EXPORTER_OTLP_ENDPOINT)
return;
registerOTel({ serviceName: "sam" });
};

0 comments on commit 6797b37

Please sign in to comment.