From 79743b6b346e253621cb013294f992d7d6c1b1cc Mon Sep 17 00:00:00 2001 From: Adnan Rahic Date: Tue, 13 Feb 2024 09:24:11 +0100 Subject: [PATCH] docs(cfw): Add better prereqs and npx guide --- docs/docs/examples-tutorials/recipes.mdx | 1 + ...flare-workers-with-opentelemetry-tracetest.mdx | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/docs/examples-tutorials/recipes.mdx b/docs/docs/examples-tutorials/recipes.mdx index 9686ac01bb..90865883fb 100644 --- a/docs/docs/examples-tutorials/recipes.mdx +++ b/docs/docs/examples-tutorials/recipes.mdx @@ -37,6 +37,7 @@ These recipes show how to trigger Tracetest test runs with message queues like K These recipes show how to run tests against Serverless Functions with Tracetest. - [Testing Vercel Functions with OpenTelemetry](/examples-tutorials/recipes/testing-vercel-functions-with-opentelemetry-tracetest) +- [Testing Cloudflare Workers with OpenTelemetry](/examples-tutorials/recipes/testing-cloudflare-workers-with-opentelemetry-tracetest) ## Trace Data Stores diff --git a/docs/docs/examples-tutorials/recipes/testing-cloudflare-workers-with-opentelemetry-tracetest.mdx b/docs/docs/examples-tutorials/recipes/testing-cloudflare-workers-with-opentelemetry-tracetest.mdx index 432b2f9711..184d1f2d5d 100644 --- a/docs/docs/examples-tutorials/recipes/testing-cloudflare-workers-with-opentelemetry-tracetest.mdx +++ b/docs/docs/examples-tutorials/recipes/testing-cloudflare-workers-with-opentelemetry-tracetest.mdx @@ -52,6 +52,9 @@ The Cloudflare Worker will fetch data from an external API, transform the data a - Create an [environment](/concepts/environments). - Create an [environment token](/concepts/environment-tokens). - Have access to the environment's [agent API key](/configuration/agent). + +### Cloudflare Account + - [Cloudflare Workers Account](https://workers.cloudflare.com/) - [Cloudflare D1 Database](https://developers.cloudflare.com/d1/get-started/) @@ -70,6 +73,18 @@ Before moving forward, run `npm i` in the root folder to install the dependencie npm i ``` +If you do not have [`npx`](https://www.npmjs.com/package/npx) installed, install it first. + +```bash title=Terminal +npm i npx -g +``` + +Run the command to login to your Cloudflare Workers account. + +```bash title=Terminal +npx wrangler login +``` + Run the command to create a D1 database both locally and in your Cloudflare Workers account. ```bash title=Terminal