File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ # OpenTelemetry Symfony auto-instrumentation
2+
3+ ## Requirements
4+
5+ * OpenTelemetry extension
6+ * OpenTelemetry SDK and exporters (required to actually export traces)
7+
8+ ## Overview
9+ Currently only root span creation is supported (Symfony\Component\HttpKernel\HttpKernel::handle hook).
10+
11+ To export spans, you will need to create and register a ` TracerProvider ` early in your application's
12+ lifecycle. This can be done either manually or using SDK autoloading.
13+
14+ ### Using SDK autoloading
15+
16+ See https://github.com/open-telemetry/opentelemetry-php#sdk-autoloading
17+
18+ ### Manual setup
19+
20+ ``` php
21+ <?php
22+ require_once 'vendor/autoload.php';
23+
24+ $tracerProvider = /*create tracer provider*/;
25+ $scope = \OpenTelemetry\API\Common\Instrumentation\Configurator::create()
26+ ->withTracerProvider($tracerProvider)
27+ ->activate();
28+
29+ //your application runs here
30+
31+ $scope->detach();
32+ $tracerProvider->shutdown();
33+ ```
34+
35+ ## Installation via composer
36+
37+ ``` bash
38+ $ composer require open-telemetry/opentelemetry-auto-symfony
39+ ```
40+
41+ ## Installing dependencies and executing tests
42+
43+ From Symfony subdirectory:
44+
45+ ``` bash
46+ $ composer install
47+ $ ./vendor/bin/phpunit tests
48+ ```
You can’t perform that action at this time.
0 commit comments