new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

arize-ax/setup

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Arize AX setup requires OpenTelemetry integration

Arize AX is an observability platform that works with the AI SDK through OpenTelemetry integration. It requires registering telemetry using either the AI SDK's registerTelemetry function with LegacyOpenTelemetry, or through Vercel's registerOTel/NodeSDK, with OpenInference span processors (SimpleSpanProcessor or BatchSpanProcessor).

Arize AX Next.js setup dependencies

For Next.js environments, install: ai, @ai-sdk/openai, @ai-sdk/otel, @vercel/otel, @arizeai/openinference-vercel, and @opentelemetry/exporter-trace-otlp-proto.

Arize AX OTLP trace exporter endpoint and headers

The OTLP trace exporter should be configured with url: 'https://otlp.arize.com/v1/traces' and headers containing space_id and api_key from environment variables (ARIZE_SPACE_ID and ARIZE_API_KEY).

Arize AX project name configuration via model_id

Spans sent to Arize AX will appear under the project specified in the model_id field within the resource attributes or registerOTel configuration.

Arize AX Node.js setup with NodeSDK

For Node.js using NodeSDK, install: ai, @ai-sdk/openai, @ai-sdk/otel, @opentelemetry/sdk-node, @arizeai/openinference-vercel, @opentelemetry/exporter-trace-otlp-proto, and @opentelemetry/resources. Configure NodeSDK with resource attributes (model_id, model_version) and OpenInferenceSimpleSpanProcessor pointing to the Arize endpoint.

Arize AX Node.js setup with NodeTraceProvider

For Node.js using NodeTraceProvider, install: ai, @ai-sdk/openai, @ai-sdk/otel, @opentelemetry/sdk-trace-node, @arizeai/openinference-vercel, @opentelemetry/exporter-trace-otlp-proto, and @opentelemetry/resources. Create NodeTracerProvider with resource attributes and span processors, then call provider.register().

Arize AX Next.js integration example

Example Next.js instrumentation.ts file: import { registerTelemetry } from 'ai'; import { LegacyOpenTelemetry } from '@ai-sdk/otel'; import { registerOTel } from '@vercel/otel'; import { isOpenInferenceSpan, OpenInferenceSimpleSpanProcessor, } from '@arizeai/openinference-vercel'; import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto'; registerTelemetry(new LegacyOpenTelemetry()); export function register() { registerOTel({ attributes: { model_id: 'my-ai-app', model_version: '1.0.0', }, spanProcessors: [ new OpenInferenceSimpleSpanProcessor({ exporter: new OTLPTraceExporter({ url: 'https://otlp.arize.com/v1/traces', headers: { space_id: process.env.ARIZE_SPACE_ID, api_key: process.env.ARIZE_API_KEY, }, }), spanFilter: isOpenInferenceSpan, }), ], }); }

Arize AX NodeTraceProvider integration example

Example Node.js instrumentation.ts with NodeTraceProvider: import { registerTelemetry } from 'ai'; import { LegacyOpenTelemetry } from '@ai-sdk/otel'; import { isOpenInferenceSpan, OpenInferenceSimpleSpanProcessor, } from '@arizeai/openinference-vercel'; import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto'; import { resourceFromAttributes } from '@opentelemetry/resources'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; const provider = new NodeTracerProvider({ resource: resourceFromAttributes({ model_id: 'my-ai-app', model_version: '1.0.0', }), spanProcessors: [ new OpenInferenceSimpleSpanProcessor({ exporter: new OTLPTraceExporter({ url: 'https://otlp.arize.com/v1/traces', headers: { space_id: process.env.ARIZE_SPACE_ID, api_key: process.env.ARIZE_API_KEY, }, }), spanFilter: isOpenInferenceSpan, }), ], }); provider.register(); registerTelemetry(new LegacyOpenTelemetry());

Give your agent this brain