Skip to content

Commit

Permalink
fix symfony breakages (#322)
Browse files Browse the repository at this point in the history
* update TraceableTracerProvider to support SDK 1.1.0+ (add updateConfigurator method).
* update sdk dependency to 1.1 (which drops PHP 7.4+8.0 support)
* update SystemClock refs from sdk to api
* update psalm config
* dont build symfony for 7.4 or 8.0
* remove polyfill-80
  • Loading branch information
brettmc authored Jan 9, 2025
1 parent 9948a01 commit 6542b13
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
php-version: 7.4
- project: 'Sampler/RuleBased'
php-version: 8.0
- project: 'Symfony'
php-version: 7.4
- project: 'Symfony'
php-version: 8.0
steps:
- uses: actions/checkout@v4

Expand Down
11 changes: 5 additions & 6 deletions src/Symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
"license": "Apache-2.0",
"authors": [
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-json": "*",
"open-telemetry/api": "^1",
"open-telemetry/context": "^1",
Expand All @@ -35,14 +34,14 @@
"friendsofphp/php-cs-fixer": "^3.0",
"google/protobuf": "^3.23",
"guzzlehttp/guzzle": "^7.3",
"guzzlehttp/psr7": "^2.0@RC",
"guzzlehttp/psr7": "^2.0",
"jangregor/phpstan-prophecy": "^1.0",
"kriswallsmith/buzz": "^1.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"mikey179/vfsstream": "^1.6",
"nyholm/psr7": "^1.4",
"open-telemetry/dev-tools": "dev-main",
"open-telemetry/sdk": "^1",
"open-telemetry/sdk": "^1.1",
"phan/phan": "^4.1 || ^5",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.4",
Expand All @@ -54,7 +53,6 @@
"symfony/http-client": "^5.3",
"symfony/http-kernel": "^4.4|^5.3|^6.0",
"symfony/options-resolver": "^4.4|^5.3|^6.0",
"symfony/polyfill-php80": "^1.16",
"symfony/proxy-manager-bridge": "^4.4|^5.3|^6.0",
"symfony/yaml": "^4.4|^5.3|^6.0",
"vimeo/psalm": "^5.0"
Expand All @@ -76,8 +74,9 @@
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"php-http/discovery": false,
"symfony/runtime": true,
"php-http/discovery": false
"tbachert/spi": true
}
}
}
2 changes: 2 additions & 0 deletions src/Symfony/psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<psalm
errorLevel="3"
cacheDirectory="var/cache/psalm"
findUnusedBaselineEntry="false"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/src/OtelBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"require": {
"php": "^7.4 || ^8.0",
"composer-runtime-api": "^2.0",
"open-telemetry/api": "^0.0.14",
"open-telemetry/context": "^0.0.14",
"open-telemetry/api": "^1",
"open-telemetry/context": "^1",
"open-telemetry/sem-conv": "^1.23",
"symfony/config": "^4.4 || ^5.4 || ^6.1",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use OpenTelemetry\API\Trace\TracerInterface;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DataCollector\OtelDataCollector;
use OpenTelemetry\SDK\Common\Future\CancellationInterface;
use OpenTelemetry\SDK\Common\InstrumentationScope\Configurator;
use OpenTelemetry\SDK\Trace\TracerProviderInterface;

/** @phan-file-suppress PhanUndeclaredInterface */
Expand Down Expand Up @@ -40,4 +41,8 @@ public function getTracer(string $name, ?string $version = null, ?string $schema
{
return $this->tracerProvider->getTracer($name, $version, $schemaUrl, $attributes);
}

public function updateConfigurator(Configurator $configurator): void
{
}
}
2 changes: 1 addition & 1 deletion src/Symfony/src/OtelSdkBundle/Resources/config/sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
namespace OpenTelemetry\Contrib\Symfony\OtelSdkBundle\Resources;

use OpenTelemetry\API;
use OpenTelemetry\API\Common\Time\SystemClock;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\Ids;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\Parameters;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\Util\ConfigHelper;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\Util\ServiceHelper;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\Util\ServicesConfiguratorHelper;
use OpenTelemetry\SDK;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Common\Time\SystemClock;
use OpenTelemetry\SDK\Resource;
use OpenTelemetry\SDK\Trace;
use OpenTelemetry\SDK\Trace\Sampler;
Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/src/OtelSdkBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"homepage": "https://github.com/open-telemetry/opentelemetry-php-contrib/graphs/contributors"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4 || ^8.0",
"open-telemetry/sdk-contrib": "self.version",
"open-telemetry/sdk": "self.version",
"php": "^8.1",
"open-telemetry/sdk": "^1.1",
"open-telemetry/exporter-otlp": "^1.0",
"open-telemetry/exporter-zipkin": "^1.0",
"open-telemetry/transport-grpc": "^1.0",
"php-http/message": "^1.12",
"php-http/discovery": "^1.14",
"symfony/config": "^4.4|^5.3|^6.0",
"symfony/options-resolver": "^4.4|^5.3|^6.0",
"symfony/polyfill-php80": "^1.16",
"symfony/dependency-injection": "^4.4|^5.3|^6.0"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace OpenTelemetry\Tests\Contrib\Symfony\Integration\OtelSdkBundle\DependencyInjection;

use Exception;
use OpenTelemetry\API\Common\Time\SystemClock;
use OpenTelemetry\Contrib\Otlp\SpanExporterFactory as OtlpExporterFactory;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\OtelSdkExtension;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\Parameters;
Expand All @@ -15,7 +16,6 @@
use OpenTelemetry\Contrib\Zipkin\SpanExporterFactory as ZipkinSpanExporterFactory;
use OpenTelemetry\SDK;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Common\Time\SystemClock;
use OpenTelemetry\SDK\Trace\SpanProcessor;
use OpenTelemetry\Tests\Contrib\Symfony\Integration\OtelSdkBundle\Mock;
use OpenTelemetry\Tests\Contrib\Symfony\Integration\OtelSdkBundle\Mock\SpanExporterFactory as MockSpanExporterFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace OpenTelemetry\Tests\Contrib\Symfony\Integration\OtelSdkBundle\Resources;

use Exception;
use OpenTelemetry\API\Common\Time\SystemClock;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\OtelSdkExtension;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\DependencyInjection\Parameters;
use OpenTelemetry\Contrib\Symfony\OtelSdkBundle\Util\ServiceHelper;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Common\Time\SystemClock;
use OpenTelemetry\SDK\Resource;
use OpenTelemetry\SDK\Trace;
use OpenTelemetry\SDK\Trace\Sampler;
Expand Down

0 comments on commit 6542b13

Please sign in to comment.