Skip to content

Enable DSM tests for PHP [php@feat/arjun.guha/dsm-php-integration] - #8202

Draft
arjunguhaswe wants to merge 2 commits into
mainfrom
arjun.guha/php-dsm-system-tests
Draft

arjunguhaswe wants to merge 2 commits into
mainfrom
arjun.guha/php-dsm-system-tests

Conversation

@arjunguhaswe

@arjunguhaswe arjunguhaswe commented Oct 27, 2026 •

Copy link
Copy Markdown

Motivation

DataDog/dd-trace-php#4380 adds Data Streams Monitoring to the PHP tracer for Kafka (php-rdkafka) and RabbitMQ (php-amqplib), to ship in 1.27.0. This enables the DSM tests for PHP.

Changes

  • weblogs/plain/dsm.php, shared by the php-fpm and apache-mod weblogs:
    • /dsm?integration=kafka|rabbitmq|rabbitmq_topic_exchange|rabbitmq_fanout_exchange produces, then consumes, and answers ok only once every message it waits for has been consumed.
    • The Kafka consumer is assigned partition 0, with group.id set, instead of subscribing. Test_DsmKafka uses the default 5 s request timeout, and assigning skips the group rebalance. Locally, requests took 20-90 ms, and the checkpoints still carry group:.
    • /dsm/inject and /dsm/extract call the tracer's checkpoint function, as the Node.js and Python weblogs call theirs.
  • Base images:
    • php-rdkafka: the ondrej package on php-fpm, built from source on apache-mod (whose PHP is built from source);
    • php-amqplib through composer;
    • sockets and rdkafka in common/php.ini;
    • DD_DATA_STREAMS_ENABLED=true.
  • Manifest, enabled from 1.27.0 except on laravel11x and symfony7x, which don't have the endpoint:
    • Kafka, through test_dsm_kafka_without_cluster_id, as for .NET. php-rdkafka doesn't expose the cluster id, so test_dsm_kafka is missing_feature.
    • RabbitMQ direct, topic and fanout exchanges.
    • Context injection and extraction.
    • Manual checkpoints stay missing_feature, because PHP has no public manual checkpoint API. HTTP, SQS, SNS and Kinesis aren't implemented in the tracer.
  • base-images.lock.json regenerated for the 25 PHP base images.

Testing

Run locally (arm64) against a tracer built from the head of DataDog/dd-trace-php#4380:

  • php-fpm-8.2 and apache-mod-8.0: the 6 enabled DSM tests pass (as XPASS, since the dev build reports 1.26.0), and the full INTEGRATIONS scenario has no failures.
  • The apache-mod-7.0-zts base image builds and loads rdkafka.

[php@feat/arjun.guha/dsm-php-integration] in the title points the dev weblogs at #4380. It needs ghcr.io/datadog/dd-trace-php/dd-library-php:feat-arjun-guha-dsm-php-integration, which dd-trace-php's CI hasn't published yet; I couldn't find an image for any open dd-trace-php PR. The target branch is also why "Fail if target branch is specified" fails.

Before merging

🤖 Generated with Claude Code

Add a /dsm endpoint to the plain PHP weblog (php-fpm and apache-mod):
Kafka through php-rdkafka, RabbitMQ direct, topic and fanout exchanges
through php-amqplib, and /dsm/inject and /dsm/extract. Install the
clients in the base images, enable DSM there, and enable the tests from
1.27.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/php/weblogs/plain/dsm.php                            @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
mirror_images.lock.yaml                                                 @DataDog/system-tests-core
mirror_images.yaml                                                      @DataDog/system-tests-core
utils/build/docker/base-images.lock.json                                @DataDog/system-tests-reviewers
utils/build/docker/php/apache-mod.base.Dockerfile                       @DataDog/system-tests-reviewers
utils/build/docker/php/apache-mod/build.sh                              @DataDog/system-tests-reviewers
utils/build/docker/php/common/php.ini                                   @DataDog/system-tests-reviewers
utils/build/docker/php/common/rewrite-rules.conf                        @DataDog/system-tests-reviewers
utils/build/docker/php/php-fpm.base.Dockerfile                          @DataDog/system-tests-reviewers
utils/build/docker/php/php-fpm/build.sh                                 @DataDog/system-tests-reviewers
utils/build/docker/php/weblogs/plain/composer.gte8.2.json               @DataDog/system-tests-reviewers
utils/build/docker/php/weblogs/plain/composer.json                      @DataDog/system-tests-reviewers

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

Testing the test | Fail if target branch is specified

View more details · View in GitHub Actions

Testing the test | System Tests (php, dev) / Get parameters / Get parameters

View more details · View in GitHub Actions

Testing the test | all-jobs-are-green

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: aeb0812 | Docs | View more details | Give us feedback!

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant