…svc_src)
Implements the RFC "Service Override Source Attribution": tags every span
whose service was actively chosen (vs. tracer's default) with a
`_dd.svc_src` meta value identifying the source. Cleared for the default
case (DD_SERVICE-set or auto-resolved).
Sources emitted, per RFC categories:
- `<integration_name>` — when the integration sets the service (Curl,
Guzzle, PDO, Mysqli, SQLSRV, MongoDB, Memcached, AMQP, Kafka, ... via
`Integration::handleInternalSpanServiceName`)
- `opt.<option>` — when a config-driven split changes the service:
* `opt.http_client_split_by_domain` (Curl, Guzzle, Psr18, Ratchet)
* `opt.db_client_split_by_instance` (PDO, Mysqli, SQLSRV)
* `opt.redis_client_split_by_host` (PHPRedis)
- Framework root-span overrides (Laravel, LaravelQueue, Drupal, Laminas,
Lumen, Slim, SymfonyMessenger, Roadrunner, Ratchet web mode, CakePHP)
use the new `Integration::tagFrameworkServiceSource` helper: cleared
when user-set DD_SERVICE drove the value, else tagged with the
integration name.
- `m` — manual API override at serialization-time fallback in
`ddtrace_serialize_span_to_rust_span` when the span's service differs
from the root's and no other tag was set.
Inheritance per RFC: `ddtrace_inherit_span_properties` copies
`_dd.svc_src` from parent meta at span creation; no back-propagation.
Tests:
- 3 new `.phpt` covering default-cleared, manual `'m'`, and parent->child
inheritance.
- Existing `.phpt` expectations updated where manual service overrides
now correctly emit `_dd.svc_src = 'm'`.
Out of scope (follow-up):
- Predis SPLIT_BY_HOST: stores service via meta override
(`service.name`) rather than `$span->service`. Different mechanism;
worth a separate discussion.
Refs RFC "Service Override Source Attribution".
Summary
Implements the RFC "Service Override Source Attribution" for the PHP tracer.
Every span whose service was actively chosen (vs. the tracer's default) now carries a
_dd.svc_srcmeta tag identifying the source. Cleared for the default case (DD_SERVICE-set or auto-resolved).Sources emitted (per RFC categories)
<integration_name>Integration::handleInternalSpanServiceName(auto-covers Curl, Guzzle, PDO, Mysqli, SQLSRV, MongoDB, Memcached, AMQP, Kafka, …)opt.http_client_split_by_domainopt.db_client_split_by_instanceopt.redis_client_split_by_host<integration_name>(only whenDD_SERVICEis not user-set)Integration::tagFrameworkServiceSourcehelpermddtrace_serialize_span_to_rust_spanwhen span's service differs from root's and no other source tag was setDD_SERVICEor auto)