open-telemetry / open-telemetry/opentelemetry-php

[opentelemetry-php-contrib] auto PDO - add support for trace propagation through user variables

Open
#2,001 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
912
Forks
232
Avg merge
7d 16h
Merged PRs (30d)
4

Description

The collector now has a mysqlreceiver that adds trace parents to query logs. The trace parent is propagated to MySQL through a user variable @traceparent.

Similar to SqlCommenter, but instead of a comment, the library would need to run a SET @traceparent={trace}; before the intercepted query.

The opentelemetry-auto-pdo instrumentation could handle the propagation, or a new package could be introduced that'd handle it, similar to how it was done for the SqlCommenter. It might also need some configuration/ENV variables to toggle the propagation.

What do you guys think? What would be the preferred approach?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the opentelemetry-auto-pdo instrumentation and the existing SqlCommenter approach, along with the collector's mysqlreceiver behavior. Decide whether propagation belongs in the existing instrumentation or a new package, define any configuration or environment controls, and verify that intercepted queries receive the trace parent through SET @traceparent={trace};.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.