Add php-amqp plugin#146
Merged
Merged
Conversation
The phper crate update to version 0.17.5 introduces breaking changes, replacing mutable parameter access methods (get_mut_parameter, get_mut_property) with their immutable counterparts. This also removes the need for manual argument materialization in the AMQP plugin, replacing it with the new materialize_missing API, and simplifies style-based parameter access and validation.
wu-sheng
approved these changes
Jun 26, 2026
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.
Summary
This PR introduces a new php-amqp plugin that traces
AMQPExchange::publish()calls as MQ Exit spans, propagates thesw8header for distributed tracing, and includes a comprehensive e2e test suite. Along the way,phperis upgraded from0.17.2to0.17.5, which switches several phper APIs from mutable to read-only — the changes cascade acrossexecute.rs,style.rs,plugin_mysqli.rs,plugin_memcache.rs, andplugin_psr3.rs.Changes
New plugin —
php-amqp(php-amqplib's C-extension counterpart)src/plugin/plugin_amqp.rs— HooksAMQPExchange->publish()to create Exit spans withSpanLayer::Mq, extracting the broker peer fromAMQPConnection, capturing the exchange name (topic) and routing key (queue), and injectingsw8into the AMQP message headers.src/plugin/mod.rs— RegistersAmqpPlugin.tests/php/fpm/amqp.php— e2e test exercising one-arg through five-arg publish calls, verifying bothsw8injection and preservation of user-supplied headers.tests/e2e.rs— Addsrequest_fpm_amqp().tests/data/expected_context.yaml— Adds the 5 expected AMQP exit spans and the entry span for/amqp.php, bumpingsegmentSizefrom 20 → 21.librabbitmq-devand enablesamqpPHP extension.phper 0.17.2 → 0.17.5 upgrade
Cargo.toml/Cargo.lock— phper0.17.2→0.17.5, phper-alloc0.16.1→0.16.3, phper-build0.15.4→0.15.6, phper-macros0.15.2→0.15.3, phper-sys0.15.4→0.15.6.dist-material/LICENSE— Updates version strings for all phper crates.Refactoring to match phper's read-only API shift
src/execute.rs:infer_request_id—get_mut_parameter(0).as_mut_z_obj()→get_parameter(0).as_z_obj(),get_mut_property("fd")→get_property("fd").src/plugin/style.rs— Removesvalidate_num_argsandget_mut_parameter(both mutation-based); addsget_parameter(read-only). Callers no longer passApiStylefor arg validation.src/plugin/plugin_mysqli.rs— Rewritesget_peer_by_parametersto accept explicit(class_name, function_name)and determine correct host/port indices per function signature, instead of relying onApiStyleand mutable params.src/plugin/plugin_memcache.rs—get_mut_parameter→get_parameter.src/plugin/plugin_psr3.rs— Addsvalidate_num_argsguards so that optionalcontextarguments don't panic on OOB access.Documentation
README.md— Marksphp-amqpas supported (✅) for Message Queuing Producer.