Skip to content

Wrong composer version dependency #1922

@JoniJnm

Description

@JoniJnm

Error:

Undefined constant OpenTelemetry\SemConv\Version::VERSION_1_38_0 in vendor/open-telemetry/sdk/Resource/Detectors/Environment.php:26

Hi,

I was using open-telemetry/sdk:1.9.0 and I have upgraded some dependencies

I have run a composer update --minimal-changes:

https://getcomposer.org/doc/03-cli.md#update-u-upgrade

--minimal-changes (-m): Only perform absolutely necessary changes to dependencies. If packages cannot be kept at their currently locked version they are updated. For partial updates the allow-listed packages are always updated fully. Can also be set via the COMPOSER_MINIMAL_CHANGES=1 env var.

Now I'm using open-telemetry/sdk:1.13

My project doesn't require directly open-telemetry/sem-conv. It was using the version 1.37.0

The problem is, open-telemetry/sdk:1.13 needs open-telemetry/sem-conv:1.38, so PHP was failing in this line:

https://github.com/opentelemetry-php/sdk/blob/1.13.0/Resource/Detectors/Environment.php#L26

return ResourceInfo::create(Attributes::create($attributes), Version::VERSION_1_38_0->url());

because open-telemetry/sem-conv:1.37 doesn't include the constant VERSION_1_38_0

The composer.json file should specify the min version?

https://github.com/opentelemetry-php/sdk/blob/1.13.0/composer.json#L25

So open-telemetry/sdk:1.13 instead of

"open-telemetry/sem-conv": "^1.0",

should use:

"open-telemetry/sem-conv": "^1.38",

no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions