Client Library
The Fiberplane Studio client library integrates with the Hono web framework to send OpenTelemetry traces to Fiberplane Studio, and give you rich application context while you’re developing.
Installation
The install process is nothing novel. To install the client library in your Hono project by running the following command:
Usage within Hono
Below is an example of how to integrate the client library in a Hono app:
Advanced usage: Custom spans
The measure
function from the client library allows you to create custom spans for any function within your application, enabling more granular tracing.
Configuration
By default, the client library does not send traces. To start sending data to Fiberplane Studio, you need to set the FPX_ENDPOINT
environment variable.
When starting Fiberplane Studio via the command line with npx @fiberplane/studio
, the FPX_ENDPOINT
is automatically set to Fiberplane Studio’s default ingestion endpoint: http://localhost:8788/v1/traces
.
If you are using Cloudflare workers, ensure that Node.js compatibility mode must be enabled in your wrangler.toml
file:
By default, the Fiberplane Studio CLI setup will enable Node.js compatibility mode for Cloudflare Workers.
Customizing the client library behavior
The client library allows you to override the default behavior of the instrument
function.
By default, instrument
will change the behavior of fetch
and console.*
methods, in order to produce telemetry data for all fetch
requests and logging events.
You can disable these features by setting the following configuration parameters to false
:
To explore more of what the client library can do, check out the code on Github.