Skip to main content
Quickly start capturing telemetry data from your generative AI capabilities. After installation and configuration, follow the Axiom AI engineering workflow to create, evaluate, observe, and iterate.
This page explains how to set up instrumentation with Axiom AI SDK. Expand the section below to choose the right instrumentation approach for your needs.
Axiom offers the following approaches to capture generative AI telemetry:Instrumentation with Axiom AI SDK is the right choice for you if you have a TypeScript app and you want the SDK to capture and send traces with the correct semantic conventions.Manual instrumentation is the right choice for you if you want to use your own tooling or if you use a language other than TypeScript. You need to instrument your app manually to emit traces compatible with Axiom’s AI engineering features.Both approaches emit identical attributes. This means that all the telemetry analysis features work the same way.

Prerequisites

Install

Install Axiom AI SDK into your TypeScript project:
The axiom package includes the axiom command-line interface (CLI) for running evaluations, which you’ll use to systematically test and improve your AI capabilities.

Configure tracer

To send data to Axiom, configure a tracer. For example, use a dedicated instrumentation file and load it before the rest of your app. An example configuration for a Node.js environment:
  1. Install dependencies:
  2. Create an instrumentation file:
    /src/instrumentation.ts
For more information on specifying redaction policies, see Redaction policies.

Create Axiom configuration file

The Axiom configuration file enables the evaluation framework, allowing you to run systematic tests against your AI capabilities and track improvements over time. At the root of your project, create the Axiom configuration file /axiom.config.ts:
/axiom.config.ts

Store environment variables

Store environment variables in an .env file in the root of your project:
.env
Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME with the name of the Axiom dataset where you send your data.Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.Enter the API keys for the LLMs you want to work with.
To run evaluations, you’ll need to authenticate the Axiom CLI. See Setup and authentication for details on using axiom auth login.

What’s next?

  • Build your first capability: Start prototyping with Create.
  • Set up evaluations: Learn how to systematically test your capabilities with Evaluate.
  • Capture production telemetry: Instrument your AI calls for observability with Observe.