Download the PHP package nadi-pro/nadi-php without Composer
On this page you can find all versions of the php package nadi-pro/nadi-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nadi-php
Nadi PHP Client
A PHP SDK for application crash/error monitoring with built-in OpenTelemetry support for industry-standard observability.
Documentation
Full documentation is available in the docs/ directory:
- Architecture - System design and patterns
- Development - Developer guides and testing
- Usage - Practical integration guides
- API Reference - Class and interface documentation
Requirements
- PHP 8.1 or higher
- Composer
Installation
Features
- 🔭 OpenTelemetry Integration: Built-in support for OTel semantic conventions
- 📊 Rich Metrics: Comprehensive system, runtime, network, and custom metrics
- 🎯 Smart Sampling: Multiple sampling strategies including fixed-rate, interval-based, peak-load, and dynamic
- 🚀 Multiple Transporters: HTTP API, Local Logging, and OpenTelemetry exporters
- 🔄 Trace Correlation: Automatic trace context capture for distributed tracing
- 📦 Shipper Binary Manager: Auto-download and manage the Nadi Shipper binary
OpenTelemetry Support
Nadi PHP SDK now includes first-class support for OpenTelemetry (OTel), enabling seamless integration with modern observability platforms like Jaeger, Prometheus, Grafana, Datadog, and New Relic.
OpenTelemetry Transporter
Configure Nadi to export telemetry data using the OpenTelemetry Protocol (OTLP):
OpenTelemetry Semantic Conventions
All metrics now follow OTel semantic conventions for consistency and interoperability:
System Metrics
Runtime Metrics
Operating System Metrics
Network Metrics
Trace Context Correlation
Nadi automatically captures OpenTelemetry trace context for distributed tracing:
Connecting to Observability Backends
Jaeger
Grafana Tempo
Local Development (Jaeger All-in-One)
Testing
Run the test suite:
Note: OpenTelemetry tests may show connection warnings if Jaeger is not running locally. These are expected and the tests will still pass. To run tests with a live OTLP endpoint, start Jaeger first:
Security & Data Privacy
Important: Nadi captures and transmits application error data including exception messages, stack traces, SQL queries, HTTP request details, and custom content you pass to
Entry::make(). This data may contain Personally Identifiable Information (PII).
As the SDK consumer, you are responsible for:
- Sanitizing or redacting PII from
Entrycontent before callingstore() - Filtering sensitive HTTP headers (e.g.,
Authorization,Cookie) from metric/entry data - Ensuring compliance with your organization's data handling policies (GDPR, HIPAA, SOC2, etc.)
- Using HTTPS endpoints for all transporters in production environments
See SECURITY.md for vulnerability reporting and security considerations.
Adding New Metric
You can add a new metric as you see fit to your application / framework.
Do take note, all metrics will be converted to associative array.
In order to create your own metrics, you need to extend the class Nadi\Metric\Base and implement
your metrics details in metrics() method which always returns an array. You may need to define
as a dot notation in your metric.
However, Nadi will convert to the associative array.
Following is an example for capture Http request for Laravel framework.
Once you have declared your metric, you can use in your application:
If you are adding from Laravel framework, you can simply just add in config/nadi.php:
Class Diagram
Sampling
Following are the sampling strategy provided by default:
- Base Sampling
- Fix Rate Sampling
- Interval Sampling
- Peak Load Sampling
- Dynamic Rate Sampling
Usage
The Sample Config can be construct as following:
Then based on available sampling strategy, contruct the sampling object:
You can use directly the sampling:
Or you require Sampling Manager:
Use Sampling Manager if you rely on dynamic use of sampling stategy.
Create Your Own Sample Strategy
To create your own sampling strategy:
Shipper Binary Manager
The SDK includes a shared library for managing the Nadi Shipper binary. This allows automatic downloading and installation of the shipper binary across different PHP packages (Laravel, WordPress, etc.).
Supported Platforms
| Operating System | Architectures |
|---|---|
| Linux | amd64, 386, arm64 |
| macOS (Darwin) | amd64, arm64 |
| Windows | amd64 |
Basic Usage
Components
PlatformDetector
Detects the current operating system and architecture:
VersionResolver
Resolves versions from GitHub releases:
Exception Handling
The library uses specific exceptions for different error scenarios:
All versions of nadi-php with dependencies
guzzlehttp/guzzle Version ^6.3.1|^7.0.1
hisorange/browser-detect Version ^4.5 | ^5.0
illuminate/support Version ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
open-telemetry/api Version ^1.0
open-telemetry/sdk Version ^1.0
open-telemetry/exporter-otlp Version ^1.0
open-telemetry/sem-conv Version ^1.0
ramsey/uuid Version ^3.0 | ^4.7