Quickstart
Get your first trace into ABV in just a few minutes.1) Install packages
Install the relevant packages to get started with tracing:2) Set up environment variables
Add your ABV credentials to your environment variables. Make sure that you have a.env file in your project root and a package like dotenv to load the variables.
.env
3) Set up OpenTelemetry
Create a file namedinstrumentation.ts to initialize the OpenTelemetry SDK. The ABVSpanProcessor is the key component that sends traces to ABV.
instrumentation.ts
instrumentation.ts file to use dotenv package to load the variables.
Additional parameters are provided to get traces visible in the UI immediately.
instrumentation.ts
instrumentation.ts file at the very top of your application’s entry point (e.g., index.ts).
index.ts
4) Instrument your application
Use one of the native ABV framework integrations to automatically trace your application. Alternatively, manually instrument your application, e.g. by using thestartActiveObservation. This function takes a callback and automatically manages the observation’s lifecycle and the OpenTelemetry context. Any observation created inside the callback will automatically be nested under the active observation, and the observation will be ended when the callback finishes.
This is just an example, check out the instrumentation page for more details.
index.ts
5) Run your application
Execute your application. You should see your trace appear in the ABV UI.Packages
The ABV SDK is designed to be modular. Here’s an overview of the available packages:| Package | Description | Environment |
|---|---|---|
@abvdev/core | Core utilities, types, and logger shared across packages. | Universal JS |
@abvdev/client | Client for features like prompts, datasets, and scores. | Universal JS |
@abvdev/tracing | Core OpenTelemetry-based tracing functions (startObservation, etc.). | Universal JS |
@abvdev/otel | The ABVSpanProcessor to export traces to ABV. | Node.js ≥ 20 |
OpenTelemetry foundation
Building on OpenTelemetry is a core design choice for this SDK. It offers several key advantages:- Standardization: It aligns with the industry standard for observability, making it easier to integrate with existing monitoring and APM tools.
- Robust Context Management: OpenTelemetry provides reliable context propagation, ensuring that traces are correctly linked even in complex, asynchronous applications.
- Ecosystem & Interoperability: You can leverage a vast ecosystem of third-party instrumentations. If a library you use supports OpenTelemetry, its traces can be sent to ABV automatically.
Learn more
Setup Instrumentation Advanced usage Troubleshooting & FAQKey Features Supported
The JS/TS SDK provides full support for all ABV features:- Observability & Tracing: Comprehensive tracing of LLM applications
- Sessions: Group related traces by user journey
- User Tracking: Associate traces with specific users
- Metadata: Add structured context to traces
- Tags: Label and categorize traces
- Model Usage & Cost Tracking: Monitor tokens and costs
- Masking Sensitive Data: Redact PII and secrets
- Sampling: Control trace volume
- Prompt Management: Fetch and link prompts to traces
- Evaluations: Create datasets and custom scores
- Guardrails: Implement LLM security guardrails