Skip to content

feat(infra): export Worker telemetry to Maple via @maple-dev/alchemy - #328

Merged
Makisuo merged 1 commit into
mainfrom
feat/maple-alchemy-telemetry
Oct 10, 2026
Merged

Makisuo merged 1 commit into
mainfrom
feat/maple-alchemy-telemetry

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds @maple-dev/alchemy@0.2.0 and a shared helper, @hazel/infra/maple, which provides MapleIngest, hazelTelemetry(serviceName) and isMapleDeploy().
  • alchemy.run.ts merges Maple.providers() when MAPLE_API_KEY is set and it's not alchemy dev.
  • The api, electric-proxy and bot-gateway Workers provide Maple.Telemetry on init. The deploy binds the org's private ingest key as a Worker secret, so MAPLE_INGEST_KEY / OTEL_BASE_URL are no longer passed in.
  • telemetryEnv now sets MAPLE_ENVIRONMENT. bot-gateway now uses telemetryEnv.
  • The Cloudflare maple-traces destination is dropped on those three Workers to avoid duplicate traces. maple-logs stays.
  • deploy-prd.yml passes MAPLE_API_KEY. infra/README.md is updated.

Testing

  • bun run alchemy:typecheck passes, and tsc passes for infra, backend, electric-proxy and bot-gateway.
  • bun run alchemy:plan:prd:local (with Infisical's MAPLE_API_KEY): ingest is adopted, and api, electric-proxy and bot-gateway are updated with the new MAPLE_ENVIRONMENT var.
  • Without MAPLE_API_KEY, the plan is unchanged apart from the new env vars; the SDK is a no-op.

Before merging

  • Add MAPLE_API_KEY to the GitHub production environment secrets, or CI deploys run without Worker telemetry.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added Maple telemetry for the API, bot gateway, and electric proxy, with traces tagged by deployment environment.
    • Production deployments can connect telemetry to Maple when an API key is configured; local development remains unaffected.
  • Documentation
    • Updated infrastructure guidance with setup details for enabling Maple telemetry.

The stack merges Maple.providers() when MAPLE_API_KEY is set and reads the
org's ingest keys (Maple.IngestKeys). The api, electric-proxy and bot-gateway
Workers provide Maple.Telemetry on their init, which binds the private ingest
key as a Worker secret, so no ingest key is copied into CI or Infisical.

Traces now reach Maple through the SDK, so the Cloudflare `maple-traces`
destination is dropped on those three Workers; `maple-logs` stays for
invocation and crash logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24ffc8f2-2a0a-47bd-a556-173c1d5b5b64

📥 Commits

Reviewing files that changed from the base of the PR and between e1ecc97 and b855069.


⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock

📒 Files selected for processing (10)
  • .github/workflows/deploy-prd.yml
  • alchemy.run.ts
  • apps/backend/src/worker.ts
  • apps/bot-gateway/src/worker.ts
  • apps/electric-proxy/src/worker.ts
  • infra/README.md
  • package.json
  • packages/infra/package.json
  • packages/infra/src/cloudflare/maple.ts
  • packages/infra/src/env.ts

 _______________________________
< Yippee-ki-yay, mother-bugger! >
 -------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 48.95% 4346 / 8877
🔵 Statements 48.69% 4542 / 9327
🔵 Functions 37.41% 1078 / 2881
🔵 Branches 35.93% 1426 / 3968
File CoverageNo changed files found.
Generated in workflow #1807 for commit b855069 by the Vitest Coverage Report Action

@Makisuo
Makisuo merged commit 7a0865f into main Oct 10, 2026
5 of 7 checks passed
@Makisuo
Makisuo deleted the feat/maple-alchemy-telemetry branch October 10, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant