Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: PHP QA

on:
push:
branches: [ main ]
branches: [ main, 1.x, 2.x ]
pull_request:
branches: [ main ]
branches: [ main, 1.x, 2.x ]

jobs:
php:
Expand All @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3']
experimental: [false]
composer_args: [""]
include:
Expand Down Expand Up @@ -154,5 +154,5 @@ jobs:
needs: php
with:
matrix_extension: '["ast, json, grpc"]'
matrix_php_version: '["8.1", "8.2", "8.3"]'
matrix_php_version: '["8.2", "8.3", "8.4"]'
install_directory: '~/.test/.packages'
4 changes: 2 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Shellcheck

on:
push:
branches: [ main ]
branches: [ main, 1.x, 2.x ]
pull_request:
branches: [ main ]
branches: [ main, 1.x, 2.x ]

jobs:
shellcheck:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/split-monorepo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches:
- main
- split
release:
types: [published]
- 1.x
- 2.x
create:
workflow_dispatch:

Expand Down
1 change: 1 addition & 0 deletions .gitsplit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ splits:
origins:
- ^main$
- ^split$
- ^2.x^
6 changes: 3 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ This does the following things:
### Other PHP versions

We aim to support officially supported PHP versions, according to https://www.php.net/supported-versions.php. The
developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.1`, `8.2` and `8.3`
respectively, with `8.1` being the default. You can execute the test suite against other PHP versions by running the
developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.2`, `8.3` and `8.4`
respectively, with `8.2` being the default. You can execute the test suite against other PHP versions by running the
following command:

```bash
PHP_VERSION=8.1 make all
PHP_VERSION=8.2 make all
#or
PHP_VERSION=8.3 make all
```
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include .env

PHP_VERSION ?= 8.1
PHP_VERSION ?= 8.2
DOCKER_COMPOSE ?= docker compose
DC_RUN_PHP = $(DOCKER_COMPOSE) run --rm php

Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"readme": "./README.md",
"license": "Apache-2.0",
"require": {
"php": "^8.1",
"php": "^8.2",
"google/protobuf": "^3.22 || ^4.0",
"nyholm/psr7-server": "^1.1",
"php-http/discovery": "^1.14",
Expand Down Expand Up @@ -39,17 +39,17 @@
}
],
"replace": {
"open-telemetry/api": "1.0.x-dev",
"open-telemetry/context": "1.0.x-dev",
"open-telemetry/exporter-otlp": "1.0.x-dev",
"open-telemetry/exporter-zipkin": "1.0.x-dev",
"open-telemetry/extension-propagator-b3": "1.0.x-dev",
"open-telemetry/extension-propagator-jaeger": "0.0.2",
"open-telemetry/gen-otlp-protobuf": "1.0.x-dev",
"open-telemetry/sdk": "1.0.x-dev",
"open-telemetry/sdk-configuration": "0.1.x-dev",
"open-telemetry/sdk-contrib": "1.0.x-dev",
"open-telemetry/sem-conv": "1.0.x-dev"
"open-telemetry/api": "2.x-dev",
"open-telemetry/context": "2.x-dev",
"open-telemetry/exporter-otlp": "2.x-dev",
"open-telemetry/exporter-zipkin": "2.x-dev",
"open-telemetry/extension-propagator-b3": "2.x-dev",
"open-telemetry/extension-propagator-jaeger": "2.x-dev",
"open-telemetry/gen-otlp-protobuf": "2.x-dev",
"open-telemetry/sdk": "2.x-dev",
"open-telemetry/sdk-configuration": "2.x-dev",
"open-telemetry/sdk-contrib": "2.x-dev",
"open-telemetry/sem-conv": "2.x-dev"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -101,8 +101,8 @@
"phpstan/phpstan": "^1.10.13",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^10 || ^11",
"sebastian/exporter": "<= 6.0.1 || >= 6.1.3",
"phpunit/phpunit": "^11",
"sebastian/exporter": "^6.3",
"symfony/http-client": "^5.2",
"symfony/var-exporter": "^5.4 || ^6.4 || ^7.0",
"symfony/yaml": "^5.4 || ^6.4 || ^7.0"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
php:
image: ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base:${PHP_VERSION:-8.1}
image: ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base:${PHP_VERSION:-8.2}
volumes:
- ./:/usr/src/myapp
user: "${PHP_USER}:root"
Expand Down
5 changes: 3 additions & 2 deletions proto/otel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.2",
"google/protobuf": "^3.22 || ^4.0"
},
"autoload": {
Expand All @@ -31,7 +31,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
"dev-main": "1.x-dev",
"dev-2.x": "2.x-dev"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
14 changes: 2 additions & 12 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,30 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\ValueObject\PhpVersion;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersion::PHP_81);
$rectorConfig->phpVersion(PhpVersion::PHP_82);

$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$rectorConfig->sets([
SetList::PHP_81,
SetList::PHP_82,
SetList::CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
]);
$rectorConfig->skip([
FlipTypeControlToUseExclusiveTypeRector::class,
NewInInitializerRector::class => [
__DIR__ . '/src/SDK/Trace/Sampler/ParentBased.php',
],
ReadOnlyPropertyRector::class => [
__DIR__ . '/src/SDK/Metrics/Stream/SynchronousMetricStream.php',
__DIR__ . '/tests/Unit/Extension/Propagator',
],
DisallowedEmptyRuleFixerRector::class,
ExplicitBoolCompareRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
Expand Down
6 changes: 3 additions & 3 deletions src/API/Baggage/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace OpenTelemetry\API\Baggage;

final class Entry
final readonly class Entry
{
public function __construct(
private readonly mixed $value,
private readonly MetadataInterface $metadata,
private mixed $value,
private MetadataInterface $metadata,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/API/Baggage/Propagation/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
use function trim;
use function urldecode;

final class Parser
final readonly class Parser
{
private const EXCLUDED_KEY_CHARS = [' ', '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}'];
private const EXCLUDED_VALUE_CHARS = [' ', '"', ',', ';', '\\'];
private const EQUALS = '=';

public function __construct(
private readonly string $baggageHeader,
private string $baggageHeader,
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/API/Instrumentation/AutoInstrumentation/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
/**
* Context used for component creation.
*/
final class Context
final readonly class Context
{
public function __construct(
public readonly TracerProviderInterface $tracerProvider = new NoopTracerProvider(),
public readonly MeterProviderInterface $meterProvider = new NoopMeterProvider(),
public readonly LoggerProviderInterface $loggerProvider = new NoopLoggerProvider(),
public readonly TextMapPropagatorInterface $propagator = new NoopTextMapPropagator(),
public TracerProviderInterface $tracerProvider = new NoopTracerProvider(),
public MeterProviderInterface $meterProvider = new NoopMeterProvider(),
public LoggerProviderInterface $loggerProvider = new NoopLoggerProvider(),
public TextMapPropagatorInterface $propagator = new NoopTextMapPropagator(),
) {
}
}
4 changes: 2 additions & 2 deletions src/API/Instrumentation/SpanAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* add the argument as a span attribute.
*/
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY)]
final class SpanAttribute
final readonly class SpanAttribute
{
/**
* @param string|null $name Optional name to use for the attribute. Default: argument name.
*/
public function __construct(
public readonly ?string $name = null,
public ?string $name = null,
) {
}
}
8 changes: 4 additions & 4 deletions src/API/Instrumentation/WithSpan.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* by the OpenTelemetry extension.
*/
#[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD)]
final class WithSpan
final readonly class WithSpan
{
/**
* @param string|null $span_name Optional span name. Default: function name or class::method
* @param int|null $span_kind Optional {@link SpanKind}. Default: {@link SpanKind::KIND_INTERNAL}
* @param array $attributes Optional attributes to be added to the span.
*/
public function __construct(
public readonly ?string $span_name = null,
public readonly ?int $span_kind = null,
public readonly array $attributes = [],
public ?string $span_name = null,
public ?int $span_kind = null,
public array $attributes = [],
) {
}
}
12 changes: 6 additions & 6 deletions src/API/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
}
],
"require": {
"php": "^8.1",
"open-telemetry/context": "^1.0",
"psr/log": "^1.1|^2.0|^3.0",
"symfony/polyfill-php82": "^1.26"
"php": "^8.2",
"open-telemetry/context": "^2.0",
"psr/log": "^1.1|^2.0|^3.0"
},
"conflict": {
"open-telemetry/sdk": "<=1.0.8"
"open-telemetry/sdk": "<=2.x-dev"
},
"autoload": {
"psr-4": {
Expand All @@ -35,7 +34,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.1.x-dev"
"dev-main": "1.1.x-dev",
"dev-2.x": "2.x-dev"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider keeping the API and Context packages on 1.x; bumping these packages to a new major version requires updating every instrumentation package which might slow down adoption of an SDK 2.x release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's reasonable. They will still exist in the 2.x branch (as will proto, semconv), but we can avoid releasing a new version until we do make a breaking change. I think the most likely trigger for this would be removing the registry in favour of SPI (and possibly removing globals initializers at the same time).

},
"spi": {
"OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @implements ComponentProvider<LogRecordExporterInterface>
*/
#[PackageDependency('open-telemetry/exporter-otlp', '^1.0.5')]
#[PackageDependency('open-telemetry/exporter-otlp', '^2')]
final class LogRecordExporterOtlp implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @implements ComponentProvider<MetricExporterInterface>
*/
#[PackageDependency('open-telemetry/exporter-otlp', '^1.0.5')]
#[PackageDependency('open-telemetry/exporter-otlp', '^2')]
final class MetricExporterOtlp implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @implements ComponentProvider<TextMapPropagatorInterface>
*/
#[PackageDependency('open-telemetry/extension-propagator-b3', '^1.0.1')]
#[PackageDependency('open-telemetry/extension-propagator-b3', '^2')]
final class TextMapPropagatorB3 implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @implements ComponentProvider<TextMapPropagatorInterface>
*/
#[PackageDependency('open-telemetry/extension-propagator-b3', '^1.0.1')]
#[PackageDependency('open-telemetry/extension-propagator-b3', '^2')]
final class TextMapPropagatorB3Multi implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @implements ComponentProvider<TextMapPropagatorInterface>
*/
#[PackageDependency('open-telemetry/extension-propagator-jaeger', '^0.0.2')]
#[PackageDependency('open-telemetry/extension-propagator-jaeger', '^2')]
final class TextMapPropagatorJaeger implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @implements ComponentProvider<SpanExporterInterface>
*/
#[PackageDependency('open-telemetry/exporter-otlp', '^1.0.5')]
#[PackageDependency('open-telemetry/exporter-otlp', '^2')]
final class SpanExporterOtlp implements ComponentProvider
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @implements ComponentProvider<SpanExporterInterface>
*/
#[PackageDependency('open-telemetry/exporter-zipkin', '^1.0')]
#[PackageDependency('open-telemetry/exporter-zipkin', '^2')]
final class SpanExporterZipkin implements ComponentProvider
{

Expand Down
4 changes: 2 additions & 2 deletions src/Config/SDK/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
use OpenTelemetry\Config\SDK\Configuration\Environment\ServerEnvSource;
use OpenTelemetry\SDK\SdkBuilder;

final class Configuration
final readonly class Configuration
{

/**
* @param ComponentPlugin<SdkBuilder> $sdkPlugin
*/
private function __construct(
private readonly ComponentPlugin $sdkPlugin,
private ComponentPlugin $sdkPlugin,
) {
}

Expand Down
Loading
Loading