Skip to content

Commit

Permalink
update readmes (#200)
Browse files Browse the repository at this point in the history
Following on from Laravel's readme updates, apply the same to other readme files.
Add some badges, and a note to make clear that people are probably looking at a
read-only subtree split.
In passing, update wordpress dockerfile and metapackage to use RC
  • Loading branch information
brettmc authored Oct 11, 2023
1 parent 897ad76 commit 9ff3456
Show file tree
Hide file tree
Showing 18 changed files with 225 additions and 424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN composer install --ignore-platform-reqs

FROM wordpress:6.2
# Install the opentelemetry and protobuf extensions
RUN pecl install opentelemetry-beta protobuf
RUN pecl install opentelemetry protobuf
COPY otel.php.ini $PHP_INI_DIR/conf.d/.
# Copy in the composer vendor files and autoload.php
COPY --from=build /app/vendor /var/www/otel
8 changes: 8 additions & 0 deletions src/Aws/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-aws/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/Aws)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-aws)
[![Latest Version](http://poser.pugx.org/open-telemetry/contrib-aws/v/unstable)](https://packagist.org/packages/open-telemetry/contrib-aws/)
[![Stable](http://poser.pugx.org/open-telemetry/contrib-aws/v/stable)](https://packagist.org/packages/open-telemetry/contrib-aws/)

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

## Installation

Expand Down
9 changes: 9 additions & 0 deletions src/Context/Swoole/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/context-swoole/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/Context/Swoole)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/context-swoole)
[![Latest Version](http://poser.pugx.org/open-telemetry/context-swoole/v/unstable)](https://packagist.org/packages/open-telemetry/context-swoole/)
[![Stable](http://poser.pugx.org/open-telemetry/context-swoole/v/stable)](https://packagist.org/packages/open-telemetry/context-swoole/)

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

# OpenTelemetry Swoole context
55 changes: 17 additions & 38 deletions src/Instrumentation/HttpAsyncClient/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,29 @@
# OpenTelemetry HTTPlug async auto-instrumentation
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-http-async/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/HttpAsyncClient)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-http-async)
[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-http-async/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-http-async/)
[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-http-async/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-http-async/)

**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 [HttpAsyncClient](#Installation-via-composer)**
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

## Requirements
# OpenTelemetry HTTPlug async auto-instrumentation

* OpenTelemetry extension
* OpenTelemetry SDK an exporter (required to actually export traces)
* An HTTPlug async client
* (optional) OpenTelemetry [SDK Autoloading](https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/autoload_sdk.php) configured
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to
install and configure the extension and SDK.

## Overview
Auto-instrumentation hooks are registered via composer, which will:

* create spans automatically for each async request that is sent

## Manual configuration
If you are not using SDK autoloading, you will need to create and register a `TracerProvider` early in your application's lifecycle:

```php
<?php
require_once 'vendor/autoload.php';

$tracerProvider = /*create tracer provider*/;
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
->withTracerProvider($tracerProvider)
->activate();

$client->sendAsyncRequest($request);

$scope->detach();
$tracerProvider->shutdown();
```
## Installation via composer

```bash
$ composer require open-telemetry/opentelemetry-auto-http-async
```
* create spans automatically for each async HTTP request that is sent
* add a `traceparent` header to the request to facilitate distributed tracing

## 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) | http-async-client | Disable one or more installed auto-instrumentations, names are comma seperated. |
```shell
OTEL_PHP_DISABLED_INSTRUMENTATIONS=http-async-client
```

Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)
Request headers can be added as span attributes, if the header's name is found in the `php.ini` variable: `otel.instrumentation.http.request_headers`
71 changes: 16 additions & 55 deletions src/Instrumentation/IO/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# OpenTelemetry IO auto-instrumentation

**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 [IO](#Installation-via-composer)**
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-io/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/Io)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-io)
[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-io/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-io/)
[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-io/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-io/)

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

## Requirements in case of manual setup
# OpenTelemetry IO auto-instrumentation

* OpenTelemetry extension
* OpenTelemetry SDK and exporters (required to actually export traces)
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to
install and configure the extension and SDK.

## Overview
Auto-instrumentation hooks are registered via composer, and spans will automatically be created for
folowing functions:
Auto-instrumentation hooks are registered via composer, and spans will automatically be created for the
following functions:
- `fopen`
- `fwrite`
- `fread`
Expand All @@ -20,52 +23,10 @@ folowing functions:
- `curl_init`
- `curl_exec`

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
<?php
require_once 'vendor/autoload.php';

$tracerProvider = /*create tracer provider*/;
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
->withTracerProvider($tracerProvider)
->activate();

//your application runs here

$scope->detach();
$tracerProvider->shutdown();
```

## Installation via composer

```bash
$ composer require open-telemetry/opentelemetry-auto-io
```

## Installing dependencies and executing tests

From IO subdirectory:

```bash
$ composer install
$ ./vendor/bin/phpunit tests
```

## 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):

| Name | Default value | Values | Example | Description |
|-------------------------------------|---------------|-------------------------|---------|---------------------------------------------------------------------------------|
| OTEL_PHP_DISABLED_INSTRUMENTATIONS | [] | Instrumentation name(s) | io | Disable one or more installed auto-instrumentations, names are comma seperated. |
The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):

Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)
```shell
OTEL_PHP_DISABLED_INSTRUMENTATIONS=io
```
68 changes: 15 additions & 53 deletions src/Instrumentation/Laravel/README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,24 @@
# OpenTelemetry Laravel auto-instrumentation
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-laravel/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/Laravel)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-laravel)
[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-laravel/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-laravel/)
[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-laravel/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-laravel/)

**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 [Laravel](#Installation-via-composer)**
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

## Requirements
# OpenTelemetry Laravel auto-instrumentation

* OpenTelemetry extension
* OpenTelemetry SDK and exporters (required to actually export traces)
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 (Illuminate\Foundation\Http\Kernel::handle 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
<?php
require_once 'vendor/autoload.php';

$tracerProvider = /*create tracer provider*/;
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
->withTracerProvider($tracerProvider)
->activate();

//your application runs here

$scope->detach();
$tracerProvider->shutdown();
```

## Installation via composer

```bash
$ composer require open-telemetry/opentelemetry-auto-laravel
```

## Installing dependencies and executing tests

From Laravel subdirectory:

```bash
$ composer install
$ ./vendor/bin/phpunit tests
```
Auto-instrumentation hooks are registered via composer, and spans will automatically be created.

## 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) | laravel | 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=laravel
```
67 changes: 14 additions & 53 deletions src/Instrumentation/MongoDB/README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,25 @@
# OpenTelemetry MongoDB auto-instrumentation
[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-mongodb/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/MongoDB)
[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-mongodb)
[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-mongodb/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-mongodb/)
[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-mongodb/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-mongodb/)

**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).**
**To run only this instrumentation, [install via composer](#Installation-via-composer)**
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

## Requirements
# OpenTelemetry MongoDB auto-instrumentation

- OpenTelemetry extension
- OpenTelemetry SDK and exporters (required to actually export traces)
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to
install and configure the extension and SDK.

## Overview

Auto-instrumentation hooks are registered via composer, and spans will automatically be created for all MongoDB
operations like `find` or `aggregate`.

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
<?php
require_once 'vendor/autoload.php';

$tracerProvider = /*create tracer provider*/;
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
->withTracerProvider($tracerProvider)
->activate();

//your application runs here

$scope->detach();
$tracerProvider->shutdown();
```

## Installation via composer

```bash
$ composer require open-telemetry/opentelemetry-auto-mongodb
```

## Installing dependencies and executing tests

From MongoDB subdirectory:

```bash
$ composer install
$ ./vendor/bin/phpunit tests
```

## 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) | mongodb | 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=mongodb
```
Loading

0 comments on commit 9ff3456

Please sign in to comment.