This is the demo in the README.md of the library.
NOTE: This example is identical to the README demo for Fastly Compute, except that its source files are in TypeScript. It is meant to illustrate the use of this library with TypeScript.
You will need Node.js (>= 18) and Fastly CLI (>= 9.0.3).
This example will export traces to a local instance of an OpenTelemetry Collector. It has been tested with OpenTelemetry Collector Demo.
First, build compute-js-opentelemetry
.
Clone fastly/compute-js-opentelemetry
and build it:
git clone https://github.com/fastly/compute-js-opentelemetry.git
cd compute-js-opentelemetry
npm install
npm run build
Next, move to this subdirectory, and build this example:
cd examples/readme-demo-ts
npm install
npm run build
To run this example locally:
npm run serve