Skip to content

Invalid PSR-4 Namespaces in open-telemetry/sem-conv #1735

@Rainrider

Description

@Rainrider

The files under open-telemetry/sem-conv/Incubating/Metrics have the invalid namespace OpenTelemetry\SemConv\Unstable\Metrics according to PSR-4.

The contiguous sub-namespace names after the "namespace prefix" correspond to a subdirectory within a "base directory", in which the namespace separators represent directory separators. The subdirectory name MUST match the case of the sub-namespace names.

Steps to reproduce

  1. Create a minimal composer project with mkdir otel-test && cd otel-test && composer init
    {
      "name": "user/otel-test",
      "type": "project",
      "autoload": {
          "psr-4": {
              "User\\OtelTest\\": "src/"
          }
      }
    }
    
  2. composer config optimize-autoloader true
  3. composer req open-telemetry/sem-conv

What is the expected behavior?

Generation of optimized autoload files should be successful

What is the actual behavior?

./composer.json has been updated
Running composer update open-telemetry/sem-conv
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking open-telemetry/sem-conv (1.37.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing open-telemetry/sem-conv (1.37.0): Extracting archive
Generating optimized autoload files
Class OpenTelemetry\SemConv\Unstable\Metrics\HttpIncubatingMetrics located in ./vendor/open-telemetry/sem-conv/Incubating/Metrics/HttpIncubatingMetrics.php does not comply with psr-4 autoloading standard. Skipping.
Class OpenTelemetry\SemConv\Unstable\Metrics\OtelIncubatingMetrics located in ./vendor/open-telemetry/sem-conv/Incubating/Metrics/OtelIncubatingMetrics.php does not comply with psr-4 autoloading standard. Skipping.
Class OpenTelemetry\SemConv\Unstable\Metrics\DnsIncubatingMetrics located in ./vendor/open-telemetry/sem-conv/Incubating/Metrics/DnsIncubatingMetrics.php does not comply with psr-4 autoloading standard. Skipping.
Class OpenTelemetry\SemConv\Unstable\Metrics\DbIncubatingMetrics located in ./vendor/open-telemetry/sem-conv/Incubating/Metrics/DbIncubatingMetrics.php does not comply with psr-4 autoloading standard. Skipping.
No security vulnerability advisories found
Using version ^1.37 for open-telemetry/sem-conv

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions