Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sem-Conv constant for Laravel removed, re-added, and removed again #1506

Open
nolanpro opened this issue Feb 10, 2025 · 6 comments
Open

Sem-Conv constant for Laravel removed, re-added, and removed again #1506

nolanpro opened this issue Feb 10, 2025 · 6 comments
Labels
bug Something isn't working opentelemetry-php-contrib This issue is related to the opentelemetry-php-contrib repository

Comments

@nolanpro
Copy link

Thanks for all your work on this package.

We're getting lots of these warnings spamming our logs with sem-conv

PHP Warning:  Illuminate\Queue\Worker::getNextJob(): OpenTelemetry: pre hook threw exception, class=Illuminate\Queue\Worker function=getNextJob message=Undefined constant OpenTelemetry\SemConv\TraceAttributeValues::MESSAGING_OPERATION_RECEIVE in Unknown on line 0
2025-02-10T19:49:08.834593602Z PHP Warning:  Illuminate\Queue\Worker::getNextJob(): OpenTelemetry: pre hook threw exception, class=Illuminate\Queue\Worker function=getNextJob message=Undefined constant OpenTelemetry\SemConv\TraceAttributeValues::MESSAGING_OPERATION_RECEIVE in Unknown on line 0

It looks like these constants were removed in 1.27, then added back in 1.27.1 because of this issue, then removed again 1.28.

My workaround for now is to composer require open-telemetry/sem-conv:~1.27.1 but then we get a different warning (although much less of them) OpenTelemetry: [warning] Dropped span attributes, links or events in vendor/open-telemetry/sdk/Trace/Span.php(355)

Thanks!

Describe your environment
PHP 8.3

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

composer require \
  open-telemetry/sdk \
  open-telemetry/opentelemetry-auto-laravel \
  open-telemetry/exporter-otlp \
  php-http/guzzle7-adapter \
  open-telemetry/transport-grpc --no-scripts

Then run a laravel job

What is the expected behavior?
No Warnings

What is the actual behavior?

PHP Warning:  Illuminate\Queue\Worker::getNextJob(): OpenTelemetry: pre hook threw exception, class=Illuminate\Queue\Worker function=getNextJob message=Undefined constant OpenTelemetry\SemConv\TraceAttributeValues::MESSAGING_OPERATION_RECEIVE in Unknown on line 0
2025-02-10T19:49:08.834593602Z PHP Warning:  Illuminate\Queue\Worker::getNextJob(): OpenTelemetry: pre hook threw exception, class=Illuminate\Queue\Worker function=getNextJob message=Undefined constant OpenTelemetry\SemConv\TraceAttributeValues::MESSAGING_OPERATION_RECEIVE in Unknown on line 0

Additional context

@nolanpro nolanpro added the bug Something isn't working label Feb 10, 2025
@ChrisLightfootWild
Copy link
Contributor

Hey @nolanpro 👋 - sorry to see you have encountered this.

The sem-conv package has created a few headaches over time, unfortunately.

@brettmc has this PR open-telemetry/opentelemetry-php-contrib#327 which will update to the latest sem-conv 1.30 and include relevant instrumentation changes which look to already cover this.

@ChrisLightfootWild ChrisLightfootWild added the opentelemetry-php-contrib This issue is related to the opentelemetry-php-contrib repository label Feb 11, 2025
@brettmc
Copy link
Collaborator

brettmc commented Feb 11, 2025

That PR has been merged now, should we tag a new version @ChrisLightfootWild ?

@ChrisLightfootWild
Copy link
Contributor

That PR has been merged now, should we tag a new version @ChrisLightfootWild ?

Sounds good to me, if you have some time.

@brettmc
Copy link
Collaborator

brettmc commented Feb 12, 2025

Released as 1.1.0beta1, let's give it a couple of days to see if any issues arise

@shuqingzai
Copy link

Released as 1.1.0beta1, let's give it a couple of days to see if any issues arise

@brettmc Hi, is there any plan to release a new version?

@brettmc
Copy link
Collaborator

brettmc commented Feb 25, 2025

Hi, is there any plan to release a new version?

That's fine with me, @ChrisLightfootWild is that OK with you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working opentelemetry-php-contrib This issue is related to the opentelemetry-php-contrib repository
Projects
None yet
Development

No branches or pull requests

4 participants