Skip to content

Commit

Permalink
add CREATE_CLOUDFLARE_TELEMETRY_DEBUG support
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundhung committed Sep 18, 2024
1 parent ab492c4 commit 49aabbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/create-cloudflare/src/helpers/sparrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export function hasSparrowSourceKey() {
}

export async function sendEvent(payload: EventPayload) {
if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DEBUG === "1") {
console.log("[telemetry]", JSON.stringify(payload, null, 2));
}

await fetch(`${SPARROW_URL}/api/v1/event`, {
method: "POST",
headers: {
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"npm_config_user_agent",
"CI",
"CREATE_CLOUDFLARE_TELEMETRY_DISABLED",
"CREATE_CLOUDFLARE_TELEMETRY_DEBUG",
"SPARROW_SOURCE_KEY"
],
"outputs": ["dist/**"]
Expand Down

0 comments on commit 49aabbc

Please sign in to comment.