Skip to content

Warning: ClassName::method(): OpenTelemetry: WithSpan attribute found but attribute hooks disabled in Unknown on line 0 #1476

@rauanmayemir

Description

@rauanmayemir

Describe your environment

When ext-opentelemetry is enabled and codebase has classes with #[WithSpan] attribute, opentelemetry.attr_hooks_enabled = On also needs to be set. Otherwise, the following warning is thrown in runtime:

Warning: ClassName::method(): OpenTelemetry: WithSpan attribute found but attribute hooks disabled in Unknown on line 0

It's fine having opentelemetry.attr_hooks_enabled = On in the running code, however, PHPUnit will crash with a nebulous segfault:

zsh: trace trap  ./vendor/bin/phpunit tests/

Steps to reproduce

PHP 8.2.27
PHPUnit 10.5.40

php.ini

opentelemetry.attr_hooks_enabled = On

What is the expected behavior?

Disable warning or hooks in some way and not trigger warning

What is the actual behavior?

Unless I delete #[WithSpan] attributes or disable ext-opentelemetry altogether, there is no way to fix this.

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