feat: instrument Symfony Scheduler#41
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #24.
What
Automatic OpenTelemetry instrumentation for Symfony Scheduler (https://symfony.com/doc/current/scheduler.html). One CONSUMER span per
scheduled-task run, emitted by SchedulerSubscriber listening to PreRunEvent / PostRunEvent / FailureEvent.
Attributes
OTel messaging semconv:
Traceway-specific scheduler.* namespace (anticipating any future OTel scheduler semconv):
Errors: recordException + error.type via ErrorTypeResolver. FailureEvent::shouldIgnore() is honored — ignored failures end with STATUS_OK.
Coordination with Messenger middleware
Scheduler dispatches go through the Messenger bus, which would otherwise produce duplicate PRODUCER/CONSUMER spans alongside the scheduler span.
OpenTelemetryMiddleware now skips any envelope carrying Symfony's ScheduledStamp when scheduler instrumentation is active (toggled via
$excludeScheduledMessages, wired automatically in the extension). The stamp class is referenced by string + class_exists guard so Messenger
users without symfony/scheduler aren't affected.
Configuration
open_telemetry:
scheduler_enabled: true # default
Service definition is only registered when symfony/scheduler is installed (checked via interface_exists(ScheduleProviderInterface::class),
matching the bundle's pattern for optional-dep gating).
Lifecycle
before we end the span.
Tests
behavior.