PHPackages                             justanalyticsapp/justanalytics-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. justanalyticsapp/justanalytics-php

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

justanalyticsapp/justanalytics-php
==================================

JustAnalytics PHP SDK for distributed tracing, error tracking, logging, and infrastructure metrics

00PHP

Since Mar 15Pushed 3mo agoCompare

[ Source](https://github.com/specifiedcodes/justanalytics-php)[ Packagist](https://packagist.org/packages/justanalyticsapp/justanalytics-php)[ RSS](/packages/justanalyticsapp-justanalytics-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

JustAnalytics PHP SDK
=====================

[](#justanalytics-php-sdk)

Official PHP SDK for [JustAnalytics](https://justanalytics.up.railway.app) — distributed tracing, error tracking, logging, and infrastructure metrics for PHP applications.

Requirements
------------

[](#requirements)

- PHP 8.1+
- ext-json
- ext-curl

Installation
------------

[](#installation)

```
composer require justanalyticsapp/justanalytics-php
```

Quick Start
-----------

[](#quick-start)

```
use JustAnalytics\JustAnalytics;

JustAnalytics::init([
    'siteId' => 'your-site-id',
    'apiKey' => 'ja_sk_your_api_key',
    'serviceName' => 'my-php-app',
    'environment' => 'production',
]);

// Create spans
$result = JustAnalytics::startSpan('process-order', 'internal', [], function ($span) {
    $span->setAttribute('order.id', '12345');
    return processOrder();
});

// Capture exceptions
try {
    riskyOperation();
} catch (\Throwable $e) {
    JustAnalytics::captureException($e, ['tags' => ['module' => 'payments']]);
}

// Capture messages
JustAnalytics::captureMessage('User exceeded rate limit', 'warning');

// Set user context
JustAnalytics::setUser(['id' => 'user-123', 'email' => 'alice@example.com']);

// Set tags
JustAnalytics::setTag('feature', 'checkout');

// Flush at end of request
JustAnalytics::flush();
```

Laravel Integration
-------------------

[](#laravel-integration)

The SDK auto-discovers in Laravel via the service provider. Add your credentials to `.env`:

```
JUSTANALYTICS_SITE_ID=your-site-id
JUSTANALYTICS_API_KEY=ja_sk_your_api_key
JUSTANALYTICS_SERVICE_NAME=my-laravel-app
```

Publish the config file:

```
php artisan vendor:publish --tag=justanalytics-config
```

The middleware is auto-registered and creates server spans for every HTTP request.

Symfony Integration
-------------------

[](#symfony-integration)

Register the bundle in `config/bundles.php`:

```
return [
    JustAnalytics\Integrations\Symfony\JustAnalyticsBundle::class => ['all' => true],
];
```

Add configuration in `config/packages/just_analytics.yaml`:

```
just_analytics:
    site_id: '%env(JUSTANALYTICS_SITE_ID)%'
    api_key: '%env(JUSTANALYTICS_API_KEY)%'
    service_name: '%env(JUSTANALYTICS_SERVICE_NAME)%'
```

Guzzle Auto-Instrumentation
---------------------------

[](#guzzle-auto-instrumentation)

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use JustAnalytics\Integrations\Guzzle\GuzzleMiddleware;

$stack = HandlerStack::create();
$stack->push(GuzzleMiddleware::create(), 'justanalytics');

$client = new Client(['handler' => $stack]);
```

Configuration Options
---------------------

[](#configuration-options)

OptionTypeDefaultDescription`siteId`string*required*Site ID from dashboard`apiKey`string*required*API key (ja\_sk\_...)`serviceName`string*required*Service identifier`environment`stringnullDeployment environment`release`stringnullRelease/version`serverUrl`stringproduction URLJustAnalytics server`debug`boolfalseEnable debug logging`enabled`booltrueEnable/disable SDK`async`boolfalseUse shutdown function`maxBatchSize`int100Max batch size`timeout`int5HTTP timeout (seconds)License
-------

[](#license)

MIT

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance54

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b330d668250a5b28c130028339bafa011cb3d3905eb172c588e10a1dddc2d9c?d=identicon)[justanalytics](/maintainers/justanalytics)

### Embed Badge

![Health badge](/badges/justanalyticsapp-justanalytics-php/health.svg)

```
[![Health](https://phpackages.com/badges/justanalyticsapp-justanalytics-php/health.svg)](https://phpackages.com/packages/justanalyticsapp-justanalytics-php)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B10.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1938.5M261](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
