File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Tracing in Netlify Build
2+
3+ Netlify Build relies on Open Telemetry tracing to emit trace data:
4+
5+ - https://opentelemetry.io/docs/instrumentation/js/
6+
7+ In production, trace data is exported to [ Honeycomb] ( https://ui.honeycomb.io ) . Buildbot is responsible for passing over
8+ trace information which allows build executions to be stitched together into a single trace across Buildbot and
9+ ` @netlify/build ` . The initialisation for this tracing SDK is done
10+ [ here] ( https://github.com/netlify/build/blob/main/packages/build/src/tracing/main.ts ) . We also use an open telemetry
11+ collector in production.
12+
13+ ## Adding more instrumentation
14+
15+ More data can be added by either generating more spans or adding more attributes to relevant stages. Check the Open
16+ Telemetry docs for manual instrumentation:
17+
18+ - https://opentelemetry.io/docs/instrumentation/js/manual/
19+
20+ We also have some utility methods you can leverage to do this:
21+
22+ - https://github.com/netlify/build/blob/main/packages/build/src/tracing/main.ts
23+
24+ ## Exporting data locally
25+
26+ You can export trace data when running ` @netlify/build ` locally, to do so you just need to leverage the ` tracing `
27+ [ flag properties] ( https://github.com/netlify/build/blob/main/packages/build/src/core/flags.js#L194 ) to point to
28+ Honeycomb directly. For example:
29+
30+ ```
31+ node packages/build/bin.js --debug --tracing.enabled=true --tracing.apiKey=<honeycomb-tracing-api-key> --tracing.httpProtocol=https --tracing.host=api.honeycomb.io --tracing.port=443 ../my-site
32+ ```
33+
34+ The tracing API Key should be an Honeycomb environment API key. If testing things locally you can use the ` dev `
35+ environment.
You can’t perform that action at this time.
0 commit comments