cd /news/artificial-intelligence/mastra-observability-monitoring-with… · home topics artificial-intelligence article
[ARTICLE · art-17838] src=signoz.io pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Mastra Observability & Monitoring with OpenTelemetry

SigNoz announced support for Mastra observability through OpenTelemetry, enabling developers to instrument AI applications and export traces for real-time monitoring of model performance, latency, error rates, and usage trends. The integration allows users to correlate traces, logs, and metrics across AI workflows, set alerts, and improve application reliability. Developers can set up the monitoring by configuring an OpenTelemetry exporter with a SigNoz ingestion key and registering agents with telemetry enabled in their Mastra projects.

read2 min publishedMay 27, 2026

What is Mastra Observability?

Mastra observability lets you instrument your AI applications using OpenTelemetry and export traces to SigNoz. This guide walks you through setting up Mastra monitoring so you get real-time visibility into model performance, latency, error rates, and usage trends across your Mastra applications.

With full Mastra observability in SigNoz, you can correlate traces, logs, and metrics across AI workflows, set alerts on error rates and latency, and continuously improve the reliability of your Mastra applications.

Prerequisites

  • A SigNoz Cloud accountwith an active ingestion key - Internet access to send telemetry data to SigNoz Cloud
  • Node.js (v20.0 or higher)
  • An API key from a supported Model Provider

Setting Up Mastra Observability with OpenTelemetry

You can get the full Mastra installation instructions.

Step 1: Start the CLI Wizard

Run the following command to start the interactive setup:

npx create-mastra@latest
yarn dlx create-mastra@latest
pnpm create mastra@latest
bun create mastra@latest

Step 2: Add Your API key

Add your API key to the .env

file:

OPENAI_API_KEY=<your-api-key>

This example uses OpenAI. Each LLM provider uses a unique name. See

[Model Capabilities]for more information.

Setup an Agent

Step 1: Create an agent in your project.

For example, create a file src/mastra/agents/chefAgent.ts

:

import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";

export const chefAgent = new Agent({
  name: "chef-agent",
  instructions:
    "You are Michel, a practical and experienced home chef" +
    "You help people cook with whatever ingredients they have available.",
  model: openai("gpt-4o-mini"),
});

Step 2: Register the Agent with Mastra

In your src/mastra/index.ts

file, register the agent with telemetry enabled:

import { Mastra } from "@mastra/core";
import { chefAgent } from "./agents/chefAgent";
import { OtelExporter } from "@mastra/otel-exporter";

export const mastra = new Mastra({
  agents: { chefAgent },
  observability: {
    configs: {
      otel: {
        serviceName: '<service-name>',
        exporters: [
          new OtelExporter({
            provider: {
              signoz: {
                apiKey: process.env.SIGNOZ_INGESTION_KEY,
                region: 'us', // 'us' | 'eu' | 'in',
              }
            },
          })
        ],
      },
    },
  },
});

is the name of your service<service_name>

→ Your SigNozSIGNOZ_INGESTION_KEY

ingestion key. Set the value as an environment variable.→ appropriateregion

region

Step 3: Run Mastra Dev Server and Interact with Agent

npm run dev

You should see some output similar to this:

Visit the playground url, and start chatting with the registered agent. All your interactions should be traced and sent to SigNoz under the traces tab.

View Mastra Traces in SigNoz

Once configured, your Mastra application automatically emits traces.

Traces are available in SigNoz Cloud under the Traces tab:

When you click on a trace in SigNoz, you'll see a detailed view of the trace, including all associated spans, along with their events and attributes.

Mastra Observability Dashboard

You can also check out our Mastra Dashboard which provides specialized visualizations for Mastra monitoring in your applications. The dashboard includes pre-built charts specifically tailored for LLM usage, along with import instructions to get started quickly.

── more in #artificial-intelligence 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/mastra-observability…] indexed:0 read:2min 2026-05-27 ·