Download the PHP package tracekit/laravel-apm without Composer

On this page you can find all versions of the php package tracekit/laravel-apm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-apm

TraceKit APM for Laravel

Zero-config distributed tracing and performance monitoring for Laravel applications.

Latest Version Total Downloads License

Features

Installation

Quick Start

1. Install the package

2. Add your API key to .env

Get your API key at https://app.tracekit.dev

3. Done!

Your Laravel app is now automatically traced. Visit your TraceKit dashboard to see your traces.

Local Development

Debug your Laravel application locally without creating a cloud account using TraceKit Local UI.

Quick Start

The Local UI will start at http://localhost:9999 and automatically open in your browser.

How It Works

When running in local or development environment (Laravel's APP_ENV), the SDK automatically:

  1. Detects if Local UI is running at http://localhost:9999
  2. Sends traces to both Local UI and cloud (if API key is present)
  3. Falls back gracefully if Local UI is not available

No code changes needed! Just set your .env:

Then run your app:

You'll see traces appear in real-time at http://localhost:9999.

Features

Local-Only Development

To use Local UI without cloud sending:

Traces will only go to Local UI.

Disabling Local UI

To disable automatic Local UI detection:

Learn More

Configuration

Publish the configuration file:

This creates config/tracekit.php where you can customize:

Laravel 12 Setup

Laravel 12 changed how middleware is registered. TraceKit attempts to register middleware automatically for all Laravel versions (10, 11, and 12).

If automatic registration doesn't work, you can manually add the TraceKit middleware to your bootstrap/app.php:

For most cases, the automatic registration via the service provider should work without any manual configuration.

Configuration Options

Code Monitoring (Live Debugging)

TraceKit includes production-safe code monitoring for live debugging without redeployment.

Enable Code Monitoring

Add to your .env file:

Configuration Options:

Add Debug Points

Add checkpoints anywhere in your code to capture variable state and stack traces:

Helper Functions

TraceKit provides convenient helper functions:

Automatic Breakpoint Management

What Gets Captured

Snapshots include:

Exception Handling

Exceptions are automatically captured when TRACEKIT_CODE_MONITORING_ENABLED=true - no additional code required!

The TraceKit service provider automatically registers an exception reporter that:

How It Works:

  1. Any uncaught exception is automatically reported to TraceKit
  2. Stack trace is formatted and attached to the current OpenTelemetry span
  3. Exception event includes exception.stacktrace for code discovery
  4. TraceKit backend parses stack traces and indexes your code locations
  5. Visit the "Browse Code" tab in /snapshots to see discovered code

PII Scrubbing

TraceKit Laravel SDK automatically scans snapshot variables for sensitive data before sending to the server. This ensures that passwords, API keys, and other credentials never leave your application.

How It Works

Sensitive data is detected in two ways:

  1. By variable name — Variables with sensitive names are redacted as [REDACTED:sensitive_name]
  2. By value pattern — Values matching known sensitive patterns are redacted as [REDACTED:type]

Auto-Detected Sensitive Names

The SDK flags variables whose names contain any of the following (case-insensitive):

password, passwd, pwd, secret, token, key, credential, api_key, apikey

Name matching uses letter-based boundaries (not \b) so compound names like api_key, user_token, and db_password are correctly detected.

Auto-Detected Value Patterns

Pattern Example Redacted As
Credit card numbers 4111111111111111 [REDACTED:credit_card]
Email addresses [email protected] [REDACTED:email]
Social Security Numbers 123-45-6789 [REDACTED:ssn]
JWT tokens eyJhbGciOiJIUzI1NiIs... [REDACTED:jwt]
AWS access keys AKIAIOSFODNN7EXAMPLE [REDACTED:aws_key]
Stripe keys sk_live_abc123... [REDACTED:stripe_key]
Private keys -----BEGIN RSA PRIVATE KEY----- [REDACTED:private_key]

Example

PII scrubbing is enabled by default and requires no configuration.

Kill Switch

TraceKit provides a server-side toggle to disable code monitoring per service without deploying code changes.

How It Works

When the kill switch is enabled for your service on the TraceKit dashboard (or via API), all snapshot captures are suppressed. No breakpoint data is sent.

Important: Laravel uses a per-request architecture (process-per-request), so kill switch state cannot be held in memory across requests. Instead, the SDK checks kill switch state via Laravel Cache on each request.

Controlling the Kill Switch

When disabled, code monitoring resumes automatically on the next poll cycle.

SSE Real-time Updates

Not applicable for Laravel's request lifecycle. Laravel processes each request in a separate PHP process, so persistent SSE connections are not feasible.

Instead, breakpoint updates are received via polling (default 30-second interval) and cached using Laravel's cache driver. This ensures breakpoint state is shared across all request processes.

Configure the poll interval in your .env:

Circuit Breaker

The circuit breaker protects your application if the TraceKit backend becomes unreachable.

How It Works

  1. The SDK tracks consecutive snapshot capture failures
  2. After 3 failures within 60 seconds, code monitoring is automatically paused
  3. After a 5-minute cooldown, the circuit breaker resets and captures resume

Behavior When Tripped

Metrics

Track custom metrics using Counter, Gauge, and Histogram types. Metrics are automatically exported to TraceKit using the OTLP protocol.

Basic Usage

Counter

Counters track monotonically increasing values (requests, errors, items processed):

Gauge

Gauges track point-in-time values that can go up or down (active connections, queue size):

Histogram

Histograms track value distributions (request duration, payload sizes):

HTTP Request Metrics Example

Track HTTP request metrics in your routes:

Middleware Example

Track metrics across all routes using middleware:

Tags for Dimensional Analysis

Add tags to metrics for multi-dimensional analysis:

Common Use Cases

Database Metrics:

Queue Metrics:

Business Metrics:

Metric Export

Metrics are automatically buffered and exported to TraceKit:

Metrics are flushed automatically when the buffer is full or on application shutdown.

Automatic Service Discovery

TraceKit automatically instruments outgoing HTTP calls made with Laravel's HTTP client to create service dependency graphs.

How It Works

When your service makes an HTTP request using Laravel's Http facade:

  1. ✅ TraceKit creates a CLIENT span for the outgoing request
  2. ✅ Trace context is automatically injected into request headers (traceparent)
  3. ✅ The receiving service creates a SERVER span linked to your CLIENT span
  4. ✅ TraceKit maps the dependency: YourService → TargetService

Supported HTTP Clients

Zero configuration required! Just use Laravel's HTTP client as normal:

Service Name Detection

TraceKit intelligently extracts service names from URLs:

URL Extracted Service Name
http://payment-service:3000 payment-service
http://payment.internal payment
http://payment.svc.cluster.local payment
https://api.example.com api.example.com

This works seamlessly with:

Custom Service Name Mappings

For local development or when service names can't be inferred from hostnames, add service_name_mappings to your config/tracekit.php:

Then make HTTP calls as normal:

This is especially useful when:

Example: Multi-Service Application

Viewing Service Dependencies

Visit your TraceKit dashboard to see:

Disabling Auto-Instrumentation

Add to your .env file:

Or in config/tracekit.php:

What Gets Traced?

Incoming HTTP Requests (SERVER spans)

Every HTTP request to your Laravel app is automatically traced with:

Outgoing HTTP Requests (CLIENT spans)

Every HTTP request from your Laravel app is automatically traced with:

Database Queries

All database queries are traced with:

Queue Jobs

Laravel queue jobs are traced with:

Errors and Exceptions

All exceptions are automatically captured with:

Coming Soon

The following features are planned for future releases:

Advanced Usage

Manual Tracing

You can create custom traces in your code:

Environment-Based Configuration

Disable tracing in local development:

Enable only specific features:

Sampling

Trace only a percentage of requests (e.g., 10%):

Performance

TraceKit APM is designed to have minimal performance impact:

Security

Disable query bindings:

Requirements

Support

License

MIT License. See LICENSE for details.

Credits

Built with ❤️ by the TraceKit team.


All versions of laravel-apm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/cache Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0
open-telemetry/sdk Version ^1.0
open-telemetry/exporter-otlp Version ^1.0
open-telemetry/api Version ^1.0
tracekit/php-apm Version ^1.2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tracekit/laravel-apm contains the following files

Loading the files please wait ...