-
Notifications
You must be signed in to change notification settings - Fork 394
[PROF-12372] (Draft) Hack for experimental support for publishing process context for fullhost profiler #4865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ivoanjo
wants to merge
6
commits into
master
Choose a base branch
from
ivoanjo/experimental-process-ctx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+772
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…text for fullhost profiler **What does this PR do?** This PR imports the experimental code from DataDog/fullhost-code-hotspots-wip#2 (Datadog-internal repo for now!) into Ruby so we can test out the code on Ruby apps easily. See that original PR for more details. **Motivation:** I'm opening this draft PR so I can add this to test apps in our reliability environment a bit more easily. **Additional Notes:** Since this is a quick hack, I piggy-backed on the existing process discovery support, rather than separating it out too much. **How to test the change?** The PR linked above has a script that can be used to read the data. Here's how it looks for me: ``` $ sudo otel_process_ctx_dump.sh 205306 Found OTEL context for PID 205306 Start address: 7f0f25efd000 00000000 4f 54 45 4c 5f 43 54 58 01 00 00 00 93 00 00 00 |OTEL_CTX........| 00000010 60 8a 1c 91 9c 5c 00 00 |`....\..| 00000018 Parsed struct: otel_process_ctx_signature : "OTEL_CTX" otel_process_ctx_version : 1 otel_process_payload_size : 147 otel_process_payload : 0x00005c9c911c8a60 Payload dump (147 bytes): 00000000 de 00 03 da 00 0c 73 65 72 76 69 63 65 2e 6e 61 |......service.na| 00000010 6d 65 da 00 11 74 65 73 74 2d 73 65 72 76 69 63 |me...test-servic| 00000020 65 2d 6e 61 6d 65 da 00 13 73 65 72 76 69 63 65 |e-name...service| 00000030 2e 69 6e 73 74 61 6e 63 65 2e 69 64 da 00 24 64 |.instance.id..$d| 00000040 35 30 63 33 33 63 30 2d 31 37 39 33 2d 34 37 63 |50c33c0-1793-47c| 00000050 30 2d 61 38 63 62 2d 65 38 36 62 38 62 36 61 35 |0-a8cb-e86b8b6a5| 00000060 38 62 36 da 00 1b 64 65 70 6c 6f 79 6d 65 6e 74 |8b6...deployment| 00000070 2e 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 6e 61 6d |.environment.nam| 00000080 65 da 00 0f 74 68 69 73 2d 69 73 2d 74 68 65 2d |e...this-is-the-| 00000090 65 6e 76 |env| 00000093 ```
BenchmarksBenchmark execution time: 2025-09-04 12:54:43 Comparing candidate commit db57078 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 42 metrics, 2 unstable metrics. scenario:profiling - stack collector (varying depth)
scenario:tracing - Propagation - Trace Context
|
The semantics for `shutdown!` on reconfiguration are a bit different from what I expected so the code to drop the context wasn't quite correct. In particular, when reconfiguration happens, the new component gets started before the older one shuts down; this is fine generally but since the context is a singleton it means my approach of dropping on `shutdown!` was not correct as it was tearing down the context after updating it. As a simplification, let's never drop the context. + Also fix updating the runtime-id on forks; the process discovery module actually is incorrect as it wasn't handling this, and so I did a bit of a heavy-handed thingy to fix.
Taken from https://github.com/DataDog/fullhost-code-hotspots-wip/tree/b33673d801b85a6c38fa0e9f1a139cb246737ce8/lang-exp/anonmapping-clib The ruby side of the code has not been updated yet; I'll do it in the next commit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR imports the experimental code from
https://github.com/DataDog/fullhost-code-hotspots-wip/pull/2 (Datadog-internal repo for now!) into Ruby so we can test out the code on Ruby apps easily. See that original PR for more details on what that is and how it works.
I don't expect this PR to ever be merged, it's only for easier testing.
Motivation:
I'm opening this draft PR so I can add this to test apps in our reliability environment a bit more easily.
Change log entry
None. This is not expected to be merged.
Additional Notes:
Since this is a quick hack, I piggy-backed on the existing process discovery support, rather than separating it out too much.
How to test the change?
The PR linked above has a script that can be used to read the data.
Here's how it looks for me: