Skip to content

Commit 425cac0

Browse files
Merge pull request #22 from tidal/sf_bundle
Symfony Bundle (Part1 SdkBundle)
2 parents 16db5d6 + ec52c63 commit 425cac0

File tree

74 files changed

+6173
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+6173
-23
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/docker export-ignore
2+
/examples export-ignore
3+
/tests export-ignore
4+
/.* export-ignore
5+
/*dist export-ignore
6+
/code-of-conduct.md
7+
/CODEOWNERS export-ignore
8+
/CONTRIBUTING.md export-ignore
9+
/docker-compose* export-ignore
10+
/Makefile export-ignore
11+
12+
/instrumentation/symfony/OtelSdkBundle/composer.json

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ vendor
66
coverage.clover
77
tests/coverage
88
.php_cs.cache
9+
phpunit.xml
10+
psalm.xml
11+
phpstan.neon
12+
.php-cs-fixer.cache
913

1014
# W3C Test Service build artifacts
1115
tests/TraceContext/W3CTestService/test_app
1216
tests/TraceContext/W3CTestService/trace-context
17+

README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,48 @@
1-
# opentelemetry-php-contrib
2-
opentelemetry-php-contrib
1+
# OpenTelemetry php contrib library
2+
3+
## Current Project Status
4+
This project currently lives in a pre-alpha status. Our current release is not production ready; it has been created in order to receive feedback from the community.
5+
6+
For more information, please, consult the documentation of the main [OpenTelemetry php project](https://github.com/open-telemetry/opentelemetry-php).
7+
8+
## Installation
9+
The recommended way to install the library is through [Composer](http://getcomposer.org):
10+
11+
1.) Install the composer package using [Composer's installation instructions](https://getcomposer.org/doc/00-intromd#installation-linux-unix-macos).
12+
13+
2.) Add
14+
```bash
15+
"minimum-stability": "dev",
16+
"prefer-stable": true,
17+
"repositories": [
18+
{
19+
"type": "vcs",
20+
"url": "https://github.com/open-telemetry/opentelemetry-php-contrib"
21+
}
22+
],
23+
```
24+
25+
To your project's `composer.json` file, as this utility has not reached a stable release status yet,
26+
and is not yet registered on packagist.org
27+
28+
3.) Install the dependency with composer:
29+
30+
```bash
31+
$ composer require open-telemetry/opentelemetry-php-contrib
32+
```
33+
34+
## Usage/Examples
35+
36+
### AWS
37+
- You can find examples on how to use the ASW classes in the [examples directory](/examples/aws/README.md).
38+
39+
### Symfony
40+
#### SdkBundle
41+
- The documentation for the Symfony SdkBundle can be found [here](/instrumentation/symfony/OtelSdkBundle/README.md).
42+
- An example symfony application using the SdkBundle can be found [here](https://github.com/tidal/otel-sdk-bundle-example-sf5).
43+
44+
45+
## Development
46+
47+
Please, consult the documentation of the main [OpenTelemetry php project](https://github.com/open-telemetry/opentelemetry-php).
48+

composer.json

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
"description": "The contributor repo for opentelemetry-php",
44
"type": "library",
55
"license": "Apache-2.0",
6+
"authors": [
7+
{
8+
"name": "Bob Strecansky",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"minimum-stability": "dev",
13+
"prefer-stable": true,
614
"repositories": [
715
{
816
"type": "vcs",
@@ -12,31 +20,34 @@
1220
"require": {
1321
"php": "^7.4 || ^8.0",
1422
"ext-json": "*",
15-
"open-telemetry/opentelemetry": "dev-main"
23+
"open-telemetry/opentelemetry": "dev-main",
24+
"php-http/message": "^1.12",
25+
"php-http/discovery": "^1.14"
26+
},
27+
"replace": {
28+
"open-telemetry/otel-sdk-bundle": "self.version"
29+
},
30+
"conflict": {
31+
"open-telemetry/opentelemetry": "<=0.0.3"
1632
},
17-
"authors": [
18-
{
19-
"name": "Bob Strecansky",
20-
"email": "[email protected]"
21-
}
22-
],
2333
"autoload": {
34+
"psr-4": {
35+
"OpenTelemetry\\Instrumentation\\Symfony\\": "instrumentation/symfony"
36+
},
2437
"classmap": [
2538
"detectors/",
2639
"exporters/",
2740
"instrumentation/",
28-
"propagators/",
29-
"examples/"
30-
]
41+
"propagators/"
42+
],
43+
"exclude-from-classmap": ["instrumentation/symfony/OtelSdkBundle/vendor"]
3144
},
3245
"autoload-dev": {
33-
"classmap": [
34-
"detectors/",
35-
"exporters/",
36-
"instrumentation/",
37-
"propagators/",
38-
"examples/"
39-
]
46+
"psr-4": {
47+
"OpenTelemetry\\Test\\Unit\\Symfony\\": "tests/unit/instrumentation/Symfony",
48+
"OpenTelemetry\\Test\\Integration\\Symfony\\": "tests/integration/instrumentation/Symfony"
49+
},
50+
"classmap": ["examples/"]
4051
},
4152
"require-dev": {
4253
"phpunit/phpunit": "^9.5",
@@ -49,7 +60,28 @@
4960
"psalm/plugin-phpunit": "^0.13.0",
5061
"guzzlehttp/guzzle": "^7.3",
5162
"guzzlehttp/psr7": "^2.0@RC",
52-
"symfony/http-client": "^5.2",
53-
"nyholm/psr7": "^1.4"
63+
"symfony/http-client": "^5.3",
64+
"nyholm/psr7": "^1.4",
65+
"symfony/config": "^4.4|^5.0|^6.0",
66+
"symfony/http-kernel": "^4.4|^5.3|^6.0",
67+
"symfony/polyfill-php80": "^1.16",
68+
"symfony/yaml": "^4.4|^5.3|^6.0",
69+
"symfony/proxy-manager-bridge": "^4.4|^5.3|^6.0",
70+
"symfony/options-resolver": "^4.4|^5.3|^6.0",
71+
"dg/bypass-finals": "^1.3",
72+
"kriswallsmith/buzz": "^1.2"
73+
},
74+
"suggest": {
75+
"symfony/config": "Needed to use otel-sdk-bundle",
76+
"symfony/dependency-injection": "Needed to use otel-sdk-bundle",
77+
"symfony/options-resolver": "Needed to use otel-sdk-bundle"
78+
},
79+
"scripts": {
80+
"post-install-cmd": [
81+
"composer dump-autoload --optimize"
82+
],
83+
"post-update-cmd": [
84+
"composer dump-autoload --optimize"
85+
]
5486
}
5587
}
File renamed without changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace OpenTelemetry\Instrumentation\Symfony\OtelSdkBundle\DependencyInjection;
6+
7+
interface ConfigMappings
8+
{
9+
public const SAMPLERS = [
10+
Configuration::ALWAYS_ON_SAMPLER => Samplers::ALWAYS_ON,
11+
Configuration::ALWAYS_OFF_SAMPLER => Samplers::ALWAYS_OFF,
12+
Configuration::TRACE_ID_RATIO_SAMPLER => Samplers::TRACE_ID_RATIO_BASED,
13+
Configuration::PARENT_BASED_SAMPLER => Samplers::PARENT_BASED,
14+
];
15+
public const SPAN_PROCESSORS = [
16+
Configuration::SIMPLE_PROCESSOR => SpanProcessors::SIMPLE,
17+
Configuration::BATCH_PROCESSOR => SpanProcessors::BATCH,
18+
Configuration::NOOP_PROCESSOR => SpanProcessors::NOOP,
19+
Configuration::MULTI_PROCESSOR => SpanProcessors::MULTI,
20+
];
21+
public const SPAN_EXPORTERS = [
22+
Configuration::JAEGER_EXPORTER => SpanExporters::JAEGER,
23+
Configuration::ZIPKIN_EXPORTER => SpanExporters::ZIPKIN,
24+
Configuration::NEWRELIC_EXPORTER => SpanExporters::NEWRELIC,
25+
Configuration::OTLP_HTTP_EXPORTER => SpanExporters::OTLP_HTTP,
26+
Configuration::OTLP_GRPC_EXPORTER => SpanExporters::OTLP_GRPC,
27+
Configuration::ZIPKIN_TO_NEWRELIC_EXPORTER => SpanExporters::ZIPKIN_TO_NEWRELIC,
28+
];
29+
}

0 commit comments

Comments
 (0)