🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@mastra/arthur

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons
This package has malicious versions linked to the ongoing "Mastra AI framework compromise" supply chain attack.

Affected versions:

0.3.3
View campaign page

@mastra/arthur

Arthur AI observability provider for Mastra - exports traces using OpenInference semantic conventions

unpublished
Source
npmnpm
Version
0.3.3
Version published
Weekly downloads
1.1K
61.79%
Maintainers
1
Weekly downloads
 
Created
Source

@mastra/arthur - OpenTelemetry + OpenInference Tracing Exporter

Export Mastra traces to Arthur AI using OpenInference Semantic Conventions.

Installation

npm install @mastra/arthur

Configuration

Add ArthurExporter to your Mastra configuration to export traces to Arthur. The exporter automatically reads credentials from environment variables, enabling zero-config setup.

Zero-Config

Set environment variables:

ARTHUR_API_KEY=your-api-key
ARTHUR_BASE_URL=https://app.arthur.ai
ARTHUR_TASK_ID=your-task-id  # optional, associates traces with a specific Arthur task
import { ArthurExporter } from '@mastra/arthur';
import { Mastra } from '@mastra/core/mastra';

const mastra = new Mastra({
  ...,
  observability: {
    configs: {
      arthur: {
        serviceName: 'my-service',
        exporters: [new ArthurExporter()],
      },
    },
  },
});

Explicit Configuration

import { ArthurExporter } from '@mastra/arthur';
import { Mastra } from '@mastra/core/mastra';

const mastra = new Mastra({
  ...,
  observability: {
    configs: {
      arthur: {
        serviceName: 'my-service',
        exporters: [
          new ArthurExporter({
            apiKey: 'your-api-key',
            endpoint: 'https://app.arthur.ai',
          }),
        ],
      },
    },
  },
});

Optional Configuration

new ArthurExporter({
  // Required at runtime (or set ARTHUR_API_KEY env var)
  apiKey: 'your-api-key',
  // Required at runtime (or set ARTHUR_BASE_URL env var)
  endpoint: 'https://app.arthur.ai',
  // Optional headers added to each OTLP request
  headers: {
    'x-custom-header': 'value',
  },
  // Optional log level for debugging
  logLevel: 'debug',
  // Optional batch size for the underlying BatchSpanProcessor
  batchSize: 512,
  // Optional timeout for span export
  timeout: 30000,
  // Optional resource attributes added to each span
  resourceAttributes: {
    'custom.attribute': 'value',
  },
});

Custom metadata

Custom span attributes are serialized into the OpenInference metadata payload. Add them through tracingOptions.metadata:

await agent.generate(input, {
  tracingOptions: {
    metadata: {
      companyId: 'acme-co',
    },
  },
});

OpenInference Semantic Conventions

This exporter follows the OpenInference Semantic Conventions for generative AI applications. All agent runs, tool calls, and LLM generations are automatically tagged with the correct span kinds and attributes.

License

Apache 2.0

FAQs

Package last updated on 17 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts