Download the PHP package stacktracer/stacktracer-symfony without Composer
On this page you can find all versions of the php package stacktracer/stacktracer-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stacktracer/stacktracer-symfony
More information about stacktracer/stacktracer-symfony
Files in stacktracer/stacktracer-symfony
Package stacktracer-symfony
Short Description Lightweight error tracking and tracing SDK for Symfony applications. Capture exceptions, request traces, and performance data.
License MIT
Homepage https://github.com/stacktracer/stacktracer-symfony
Informations about the package stacktracer-symfony
Stacktracer Symfony Bundle
Lightweight error tracking and tracing SDK for Symfony applications with OpenTelemetry-compatible distributed tracing. Capture exceptions, request traces, spans, breadcrumbs, logs, and performance data - all unified and linked together.
Features
- 🔗 Unified Tracing - Spans, breadcrumbs, logs, and stack traces linked by trace/span IDs
- 🌐 Distributed Tracing - W3C Trace Context (traceparent) header support
- 🔍 OTEL Compatible - OpenTelemetry-style spans with semantic conventions
- 🔐 Fingerprinting - Hash-based deduplication for cost optimization
- 📊 Monolog Integration - Automatic log capture linked to spans
- ⚡ Performance - Batching, compression, and sampling
- 🧩 Symfony Integrations - Doctrine, Messenger, Mailer, Security, Forms, Twig, Cache, Console
Feature Tiers
| Feature | Tier | Default |
|---|---|---|
| Exceptions & Stack Traces | Free | ✅ Enabled |
| Logs | Free | ✅ Enabled |
| Breadcrumbs | Free | ✅ Enabled |
| Request/Response Data | Free | ✅ Enabled |
| OTEL Spans | Paid | ❌ Disabled |
To enable OTEL spans (paid feature):
Installation
Quick Setup
1. Add environment variables
Add to your .env file:
2. Create configuration file
Create config/packages/stacktracer.yaml:
That's it! The bundle will automatically:
- Capture all unhandled exceptions with fingerprinting
- Track request performance with OTEL spans
- Capture Monolog logs linked to spans
- Propagate trace context for distributed tracing
- Send traces to your Stacktracer endpoint
Configuration Options
Manual Usage
Inject the service and use it directly:
Feature Flags & Experiments
Monitor errors as you roll out features or run A/B tests. Feature flags are linked to errors, helping identify if a feature introduced issues.
LaunchDarkly Integration
Split Integration
Distributed Tracing
The bundle automatically propagates trace context via W3C traceparent header:
Incoming requests with traceparent headers are automatically linked to the parent trace.
Symfony Integrations
All integrations are enabled by default and auto-detect component availability. Configure in stacktracer.yaml:
Available Integrations
| Integration | Component | What's Tracked |
|---|---|---|
| Doctrine DBAL | doctrine/dbal |
SQL queries, slow query detection (db.*) |
| HTTP Client | symfony/http-client |
Outgoing requests, trace propagation (http.*) |
| Messenger | symfony/messenger |
Async jobs, retries, failures (messaging.*, job.*) |
| Cache | symfony/cache |
Cache hits/misses, operations (cache.*) |
| Console | symfony/console |
CLI commands, exit codes, memory (cli.*) |
| Form | symfony/form |
Validation errors, failed submissions (form.*) |
| Security | symfony/security |
Login, logout, access denied (security.*) |
| Mailer | symfony/mailer |
Email sending, delivery failures (mail.*) |
| Twig | twig/twig |
Template renders, errors (template.*) |
Example: Form Validation Errors
Form validation errors are automatically captured as breadcrumbs:
Example: Security Events
Authentication events are tracked automatically:
Example: Mailer Tracking
Email sending is tracked with delivery status:
Data Model
Unified Linking
All data is linked together for easy frontend navigation:
Fingerprinting
Stack traces and errors are fingerprinted for:
- Deduplication - Identical errors grouped together
- Cost Optimization - Store fingerprint, not full stack on repeats
- Pattern Detection - Find similar error patterns
API Reference
TracingService
| Method | Description |
|---|---|
captureException($e, $context) |
Capture an exception |
captureMessage($msg, $level, $context) |
Capture a custom message |
addBreadcrumb($cat, $msg, $data, $level) |
Add debugging breadcrumb |
startSpan($name, $kind) |
Start a new span |
endSpan($span) |
End a span |
withSpan($name, $callback, $kind) |
Execute within a span |
getCurrentSpan() |
Get active span |
getTraceparent() |
Get W3C traceparent header |
setIncomingContext($traceparent) |
Set context from incoming header |
log($message, $level, $context) |
Add a log entry |
setTag($key, $value) |
Set global tag |
setContext($key, $value) |
Set global context |
flush() |
Force send queued traces |
Span Kinds (OTEL)
Span::KIND_INTERNAL- Internal operation (default)Span::KIND_SERVER- Server handling requestSpan::KIND_CLIENT- Client making requestSpan::KIND_PRODUCER- Message producerSpan::KIND_CONSUMER- Message consumer
Trace Levels
Trace::LEVEL_DEBUGTrace::LEVEL_INFOTrace::LEVEL_WARNINGTrace::LEVEL_ERRORTrace::LEVEL_FATAL
Requirements
- PHP 8.1+
- Symfony 6.4, 7.x, or 8.x
- ext-curl
- ext-json
License
MIT
All versions of stacktracer-symfony with dependencies
ext-json Version *
symfony/framework-bundle Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/event-dispatcher Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
psr/log Version ^2.0 || ^3.0