DataDog / dd-trace-php

Datadog PHP Clients
https://docs.datadoghq.com/tracing/setup/php
Other
481 stars 149 forks source link

feat(profiling): `thread id` label on every sample #2692

Closed realFlowControl closed 3 weeks ago

realFlowControl commented 4 weeks ago

Description

Turns out the profiling-backend assumes that all pprof based profiles emit a thread id and thread name label with every sample, so this PR aims to do this. Edit: profiling-backend was updated to not require the thread name, but we should add at least thread id anyway. Since thread names are uncommon (we don't know of a single PHP program/library which names threads), we omit thread name for now.

Took this as an opportunity to clean up a few things:

PROF-9887

Reviewer checklist

pr-commenter[bot] commented 4 weeks ago

Benchmarks

Benchmark execution time: 2024-06-10 11:38:05

Comparing candidate commit 9e04353bc99a9baa3077645f8adca48317b11a37 in PR branch florian/thread-name-id with baseline commit e63625078edc52eb92e4c6104f0daaab3ec8fa63 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 9 unstable metrics.

codecov-commenter commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.32%. Comparing base (e636250) to head (be0af97). Report is 2 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/graphs/tree.svg?width=650&height=150&src=pr&token=eXio8H7vwF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ```diff @@ Coverage Diff @@ ## master #2692 +/- ## ============================================ + Coverage 77.77% 79.32% +1.55% Complexity 2223 2223 ============================================ Files 226 200 -26 Lines 26386 22369 -4017 Branches 988 0 -988 ============================================ - Hits 20522 17745 -2777 + Misses 5338 4624 -714 + Partials 526 0 -526 ``` | [Flag](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [appsec-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `?` | | | [tracer-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `78.62% <ø> (ø)` | | | [tracer-php](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `80.33% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more. [see 26 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Last update [e636250...be0af97](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2692?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog).
realFlowControl commented 3 weeks ago

@morrisonlevi I can not approve but I approve image