@mayurajs/observability-arize
v1.1.0
Published
Arize AX for Mayura's traces, with OpenInference attributes beside the GenAI ones.
Readme
@mayurajs/observability-arize
Arize AX and Phoenix for Mayura's traces (mayura/exporter-otlp), with
OpenInference attributes beside the OpenTelemetry GenAI ones.
npm install mayura @mayurajs/observability-arizeimport { agentRunTraceSpans } from 'mayura/exporter-otlp';
import { arizeTraceExporter } from '@mayurajs/observability-arize';
const arize = arizeTraceExporter({ spaceId, apiKey, projectName: 'support-agent', region: 'us', serviceName: 'support-agent' });
await arize.sink(agentRunTraceSpans(observer.inspect(handle.id)?.recent ?? []), { signal: AbortSignal.timeout(10_000) });- Regions
us(the default),euandca.projectNameis a stable identifier, such assupport-agent. - Each span carries
openinference.span.kind(AGENTfor runs,LLMfor model calls,TOOLfor tool calls,CHAINotherwise), the model and provider, token counts, and tool and agent names, so runs show as agent traces.openInferenceAttributesis exported for other OpenInference backends' OTLP exporters (spanAttributes). - Spans are metadata only, so traces carry no prompts or outputs.
Phoenix
import { phoenixTraceExporter } from '@mayurajs/observability-arize';
// A Phoenix Cloud space; or a self-hosted Phoenix, such as http://127.0.0.1:6006 with allowInsecureLoopback: true.
const phoenix = phoenixTraceExporter({ baseUrl: 'https://app.phoenix.arize.com/s/acme', apiKey, projectName: 'support-agent', serviceName: 'support-agent' });- Phoenix takes only OTLP's protobuf encoding, so this exporter sends protobuf, with the same OpenInference attributes.
apiKeyis needed when Phoenix's authentication is on (always on Phoenix Cloud).- The
sinkalso works as thesinkofcreateWorkflowTraceExport, for durable workflow runs. - Credentials are passed in; nothing is read from the environment. Every other option is the OTLP trace exporter's.
See the observability guide. Apache-2.0.
