Set root trace name to command for CLI invocations

Created on 19 May 2025, 4 days ago

Problem/Motivation

When tracing Drush invocations, I observed that the root trace was named "GET /" and not visible distinguished from regular requests. In this context I am tracing behaviour of Migrate execution under Drush, and surfacing the command executed here would improve visibility.

Steps to reproduce

Configure OpenTelemetry, trace Requests, then use Drush commands to generate some traces. Root span names look like "GET /". It's not easy to see which are the Drush invocations in eg Grafana at a high level.

Proposed resolution

This behaviour can be changed in \Drupal\opentelemetry\OpentelemetryService::createRequestSpanName():

What do you think about making such a change?

Remaining tasks

- Discuss/agree format for showing CLI command
- ...
- Make changes
- Test coverage?

User interface changes

Traces for CLI or non-HTTP invocations of Drupal will change span name behaviour.

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇳🇿New Zealand xurizaemon Ōtepoti, Aotearoa 🏝

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024