summaryrefslogtreecommitdiffhomepage
path: root/infra/cloud.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-09-08 15:46:57 -0400
committerFrank <[email protected]>2025-09-08 15:46:59 -0400
commitcd42503e2cea32f6bceee46fbd9f257ba9a0b923 (patch)
tree7a3906d0edf7bf56fead9870018b6dd4b4a5df0e /infra/cloud.ts
parent1cea8b9e77dd72250b0b2bd1fd6572e338efc7dc (diff)
downloadopencode-cd42503e2cea32f6bceee46fbd9f257ba9a0b923.tar.gz
opencode-cd42503e2cea32f6bceee46fbd9f257ba9a0b923.zip
Zen: telemetry
Diffstat (limited to 'infra/cloud.ts')
-rw-r--r--infra/cloud.ts17
1 files changed, 13 insertions, 4 deletions
diff --git a/infra/cloud.ts b/infra/cloud.ts
index 74690669e..04997dad3 100644
--- a/infra/cloud.ts
+++ b/infra/cloud.ts
@@ -1,5 +1,6 @@
import { WebhookEndpoint } from "pulumi-stripe"
import { domain } from "./stage"
+import log from "../packages/web/dist/_worker.js/chunks/log_GHQSQ8rj.mjs"
////////////////
// DATABASE
@@ -7,7 +8,7 @@ import { domain } from "./stage"
const cluster = planetscale.getDatabaseOutput({
name: "opencode",
- organization: "sst",
+ organization: "anomalyco",
})
const branch =
@@ -103,6 +104,7 @@ const ANTHROPIC_API_KEY = new sst.Secret("ANTHROPIC_API_KEY")
const XAI_API_KEY = new sst.Secret("XAI_API_KEY")
const BASETEN_API_KEY = new sst.Secret("BASETEN_API_KEY")
const STRIPE_SECRET_KEY = new sst.Secret("STRIPE_SECRET_KEY")
+const HONEYCOMB_API_KEY = new sst.Secret("HONEYCOMB_API_KEY")
const AUTH_API_URL = new sst.Linkable("AUTH_API_URL", {
properties: { value: auth.url.apply((url) => url!) },
})
@@ -114,6 +116,14 @@ const STRIPE_WEBHOOK_SECRET = new sst.Linkable("STRIPE_WEBHOOK_SECRET", {
// CONSOLE
////////////////
+let logProcessor
+if ($app.stage === "production" || $app.stage === "frank") {
+ logProcessor = new sst.cloudflare.Worker("LogProcessor", {
+ handler: "cloud/function/src/log-processor.ts",
+ link: [HONEYCOMB_API_KEY],
+ })
+}
+
new sst.cloudflare.x.SolidStart("Console", {
domain,
path: "cloud/app",
@@ -135,9 +145,8 @@ new sst.cloudflare.x.SolidStart("Console", {
server: {
transform: {
worker: {
- placement: {
- mode: "smart",
- },
+ placement: { mode: "smart" },
+ tailConsumers: logProcessor ? [{ service: logProcessor.nodes.worker.scriptName }] : [],
},
},
},