diff --git a/src/Instrumentation/CodeIgniter/README.md b/src/Instrumentation/CodeIgniter/README.md index 2969d268..0255270b 100644 --- a/src/Instrumentation/CodeIgniter/README.md +++ b/src/Instrumentation/CodeIgniter/README.md @@ -1,66 +1,25 @@ -# OpenTelemetry CodeIgniter auto-instrumentation - -**Warning**: this is experimental, use at your own risk +[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-codeigniter/releases) +[![Issues](https://img.shields.io/badge/issues-pink)](https://github.com/open-telemetry/opentelemetry-php/issues) +[![Source](https://img.shields.io/badge/source-contrib-green)](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/CodeIgniter) +[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-codeigniter) +[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-codeigniter/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-codeigniter/) +[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-codeigniter/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-codeigniter/) -**Preferred and simplest way to install auto-instrumentation (c extension plus instrumentation libraries) is to use [opentelemetry-instrumentation-installer](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/AutoInstrumentationInstaller).** -**The same process can be done manually by installing [c extension](https://github.com/open-telemetry/opentelemetry-php-instrumentation#installation) plus all needed instrumentation libraries like [CodeIgniter](#Installation-via-composer)** +This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib. -## Requirements +# OpenTelemetry CodeIgniter auto-instrumentation -* [OpenTelemetry extension](https://opentelemetry.io/docs/instrumentation/php/automatic/#installation) -* OpenTelemetry SDK exporter (required to actually export traces) -* CodeIgniter 4.0+ installation +Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to +install and configure the extension and SDK. ## Overview -Currently only root span creation is supported (`CodeIgniter\CodeIgniter::handleRequest` hook). - -To export spans, you will need to create and register a `TracerProvider` early in your application's -lifecycle. This can be done either manually or using SDK autoloading. - -### Using SDK autoloading - -See https://github.com/open-telemetry/opentelemetry-php#sdk-autoloading - -### Manual setup - -```php -withTracerProvider($tracerProvider) - ->activate(); - -//your application runs here - -$scope->detach(); -$tracerProvider->shutdown(); -``` - -## Installation via composer - -```bash -$ composer require open-telemetry/opentelemetry-auto-codeigniter -``` - -## Installing dependencies and executing tests - -From CodeIgniter subdirectory: - -```bash -$ composer install -$ ./vendor/bin/phpunit tests -``` +Requires CodeIgniter 4.0+ ## Configuration -Parts of this auto-instrumentation library can be configured, more options are available throught the -[General SDK Configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration): +The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration): -| Name | Default value | Values | Example | Description | -|-------------------------------------|---------------|-------------------------|-------------|---------------------------------------------------------------------------------| -| OTEL_PHP_DISABLED_INSTRUMENTATIONS | [] | Instrumentation name(s) | codeigniter | Disable one or more installed auto-instrumentations, names are comma seperated. | - -Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`) +```shell +OTEL_PHP_DISABLED_INSTRUMENTATIONS=codeigniter +```