---
title: "Building Sentry's Laravel AI Integration"
description: "Sentry’s Laravel AI integration, built during an internal Agent Hackweek, provides Agent Tracing for Laravel AI agents. The author used Claude for coding, which initially produced poor generic helper code. Laravel AI emits lifecycle events for agents and tool calls, but not for individual LLM invocations. To capture these, the integration matches outgoing HTTP requests to active invocations using provider URL prefixes, associating with the most recently started invocation if multiple match. Enabling the integration requires only updating to sentry-laravel 4.27, with no Sentry-specific code. Traces appear in Sentry’s Explore > Agents section, showing conversations, tool calls, and their inputs and outputs."
---

# Building Sentry's Laravel AI Integration

[Sentry](https://yomu.fyi/company/sentry) · Martin Linzmayer · Sep 21, 2026

**Type:** Announcement

## Summary

Sentry’s Laravel AI integration, built during an internal Agent Hackweek, provides Agent Tracing for Laravel AI agents. The author used Claude for coding, which initially produced poor generic helper code. Laravel AI emits lifecycle events for agents and tool calls, but not for individual LLM invocations. To capture these, the integration matches outgoing HTTP requests to active invocations using provider URL prefixes, associating with the most recently started invocation if multiple match. Enabling the integration requires only updating to sentry-laravel 4.27, with no Sentry-specific code. Traces appear in Sentry’s Explore > Agents section, showing conversations, tool calls, and their inputs and outputs.

## Context

Sentry’s Laravel AI integration was built during an internal Agent Hackweek to give Laravel AI agents the same Agent Tracing support as other frameworks. The author used Claude for coding, which initially produced poor generic helper code. Laravel AI emits lifecycle events for agents and tool calls but not individual LLM invocations, so the integration matches HTTP requests to active invocations using provider URL prefixes.

## Takeaways

- Laravel AI emits lifecycle events for agent interactions and tool calls, but not for individual LLM invocations, requiring a workaround.
- The integration matches outgoing HTTP requests to active invocations by comparing provider URL prefixes, filtering out unrelated traffic.
- Enabling Laravel Agent Tracing requires only updating to sentry-laravel 4.27; no Sentry-specific code is needed if tracing is already active.

## FAQ

### How does the integration trace individual LLM calls?

Laravel AI emits events for agent interactions and tool calls, but not for individual LLM invocations. To capture these, the integration matches outgoing HTTP requests to active invocations by comparing the provider URL prefix, associating with the most recently started invocation if multiple match.

### Does the integration require code changes?

No, the integration requires no Sentry-specific code. If you have Sentry tracing enabled in your Laravel app, updating to sentry-laravel 4.27 enables Laravel Agent Tracing automatically when laravel/ai is installed and tracing is active.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Laravel](https://yomu.fyi/topic/laravel), [PHP](https://yomu.fyi/topic/php), [Sentry](https://yomu.fyi/topic/sentry), [Tracing](https://yomu.fyi/topic/tracing)

- Source: [Sentry](https://blog.sentry.io/sentry-laravel-ai-integration)
- Source URL: https://blog.sentry.io/sentry-laravel-ai-integration
- Ingested by Yomu: 2026-09-21T21:00:10.123Z

[Read original post](https://blog.sentry.io/sentry-laravel-ai-integration)
