Introduce process.launch_path to replace process.executable.path#3686
Introduce process.launch_path to replace process.executable.path#3686thompson-tomo wants to merge 15 commits into
Conversation
| different from the process executable in cases where the executable | ||
| is being used to run a script or other file. | ||
| For example, `python myscript.py` would have an entrypoint of | ||
| `/usr/scripts/myscript.py` but the executable would be `python`. |
There was a problem hiding this comment.
I can't find within this PR any indication of how one is expected to instrument this. I can't think of any robust way to actually consistently retrieve this information from an OS process. In the example provided, you could get that information by parsing /proc/<pid>/cmdline, but that just happens to work in the happy path, that's not sufficient for us to introduce an attribute for.
There was a problem hiding this comment.
In effect we need a way to know if the exe returned via pid is in fact the runtime. If it is a runtime then we need to switch to extracting from cmdline.
This is needed as otherwise the build_id & name of process.executable will be referring to different things with name being the same as process.runtime.
| value: 'minor' | ||
| stability: development | ||
| stability: development | ||
| - id: process.executable.path |
There was a problem hiding this comment.
I don't think this needs to be deprecated. The attribute itself is fine. It being identifying on the executable entity was my only problem.
There was a problem hiding this comment.
The issue is it needs to come off the entity as the entity is not describing an instance of the executable file but rather the executable itself regardless of where it is. This leaves no usage of the attribute.
florianl
left a comment
There was a problem hiding this comment.
From a Profiling perspective this is a hard breaking change that will cause issues around symbolization.
Instead of replacing process.executable.path with process.entrypoint, process.entrypoint should be a complementary attribute and independent from process.executable.path.
E.g. in a process that uses pytorch to do something, there will be multiple process.executable.path from a Profiling perspective. One for /usr/bin/python (or any other path to a python runtime executable), one for something like libtorch and maybe something device/GPU specific.
I agree the entity needs to be seperated, however without renaming it leads to confusion as the definition of the namespace & entity differ in what they correspond to.
The information I was given was that path is only used as a resource attribute hence we could only have 1 attribute value. The issue raised from system sig was how do we handle renaming/moving the executable hence why path can not be identifying. Isn't htlhash sufficient to perform symbolisation hence why it is on the mapping message? I also note the attributes are not mentioned in the published profiling spec. |
|
I view the Redirecting the |
| | <a id="process-context-switch-type" href="#process-context-switch-type">`process.context_switch.type`</a> |  | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary`; `involuntary` | | ||
| | <a id="process-creation-time" href="#process-creation-time">`process.creation.time`</a> |  | string | The date and time the process was created, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | | ||
| | <a id="process-environment-variable" href="#process-environment-variable">`process.environment_variable.<key>`</a> |  | string | Process environment variables, `<key>` being the environment variable name, the value being the environment variable value. [2] | `ubuntu`; `/usr/local/bin:/usr/bin` | | ||
| | <a id="process-entrypoint" href="#process-entrypoint">`process.entrypoint`</a> |  | string | The full path to the file being executed in this process. [2] | `/usr/bin/cmd/otelcol`; `/usr/scripts/myscript.py` | |
There was a problem hiding this comment.
A script can never be an executable. The shebang at the beginning of a script defined the executable.
| | <a id="process-entrypoint" href="#process-entrypoint">`process.entrypoint`</a> |  | string | The full path to the file being executed in this process. [2] | `/usr/bin/cmd/otelcol`; `/usr/scripts/myscript.py` | | |
| | <a id="process-entrypoint" href="#process-entrypoint">`process.entrypoint`</a> |  | string | The full path to the file being executed in this process. [2] | `/usr/bin/cmd/otelcol` | |
There was a problem hiding this comment.
Yes and that is why it is the entrypoint which can be the script.
As some looking at telemetry from a script, it is of more interest to me that process A is running script XYZ then the path to the runtime given I already know the runtimr via the process.runtime attributes.
There was a problem hiding this comment.
I think, there should be a wider discussion first for introducing process-entrypoint and not introducing it as a side-effect as part of this larger change.
With all the changes, from Release Candicate to Deprecated, this change is hardly noticeable but introduces a big change.
There was a problem hiding this comment.
See my proposed changes in #3686 (comment) which has this as purely a rename to ensure that process.executable.* is describing an executable which is deployed to a system. The capturing of the script would be split out to future.
I agree ideally it wouldn't have been bumped but it was decided to bump everything in one go.
The question is what is that element. Is it a file on the file system, if so path makes sense but the identity of the entity needs to be changed as we can't differentiate between 2 copies of the same executable at different locations. Or is it a compiled file which is distrubuted. That is what system sig decided it is. In which case path needs to move out and be about the process.
Isn't the build_id.htlhash sufficient to uniquely identify the executable? Hence path is not needed, especially as in most cases the name is the most important as it provides meaning to the hash.
The only time they differ is when a script is being run so I fail to see the need to have 2 entities for the runtime and how likely is it that a system would have 2 copies of the same runtime version on their system? |
Yes - |
Agree which is why we have name on the executable to describe what the hash is referring to. On the same resource we would have the process which provides additional context including path. Would the following alleviate your concerns:
This keeps the behaviour of executable.path as per now, ensures process.executable corresponds to the executable which is distrubuted and we have path forward on knowing the script which is being run in a process. If happy I will limit the scope of this PR to the rename & move with the new attribute to be tackled seperately. |
|
This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days. |
|
My concern is just that this seems really hard to instrument, and really hard to implement as a general
To my knowledge, there isn't a way to know this at any given time (short of parsing cmdline but often that doesn't actually contain the full path). You could only instrument it if you were the process yourself, guaranteeing you know when you start and reporting your own entrypoint at that point in time. Any other usecase couldn't guarantee that what they are reading is definitely the path to the executable the process was launched with. |
@braydonk This is no longer the case my updated proposal is to simply to rename the attribute and move the new attribute to the process entity. The note is made more explicit see suggestion #3686 (comment)
Yes this would be an opt-in self reported descriptive attribute and it could be discussed further in the future. For this PR we would rename |
I don't think we need to rename
This attribute likely does make the most sense on the
I guess I can get behind it as long as it's clear that default instrumentation is unlikely to report it. The attribute can be designed for situations where a given process is instrumented very specifically, and thus you understand your own rules for what |
|
I think there has been some confusion/misunderstanding, let's try to straighten it out. Process.executable.path rename This PR seeks to rename Move attribute to process entity This PR moves the attribute from the Define entrypoint attribute for scripts* Not in this pr but would be a future pr. yes it would have a note/brief of something like, "used to capture the full path to the script that is being run by an executable. It is designed to be captured when the script itself is instrumented and not externally observed.". It can be refined further in a future pr, |
|
This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new process attribute (process.launch_path) intended to represent the path of the file used to launch a process, while deprecating process.executable.path and updating the process entity/docs accordingly.
Changes:
- Added
process.launch_path(development stability) to the process attribute registry and process entity. - Deprecated
process.executable.path(renamed toprocess.launch_path) and removed it from theprocess.executableentity surface. - Updated generated registry/resource docs and added a changelog entry for the rename.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| model/process/registry.yaml | Adds process.launch_path attribute definition and removes process.executable.path from the primary registry. |
| model/process/entities.yaml | Associates process.launch_path with the process entity and removes process.executable.path from process.executable. |
| model/process/deprecated/registry-deprecated.yaml | Adds a deprecated entry for process.executable.path renamed to process.launch_path. |
| docs/resource/process.md | Documents process.launch_path in the Process resource documentation. |
| docs/registry/entities/process.md | Updates process entity registry docs (adds process.launch_path, removes process.executable.path from executable entity). |
| docs/registry/attributes/process.md | Updates process attribute registry docs (adds process.launch_path, marks process.executable.path deprecated). |
| docs/cli/cli-spans.md | Marks process.executable.path as deprecated in CLI span docs (but still lists it as Recommended). |
| .chloggen/process_entrypoint.yaml | Adds changelog entry describing the rename/replacement. |
Co-authored-by: Christophe Kamphaus <christophe.kamphaus@gmail.com>
Pull request dashboard statusStatus last refreshed: 2026-07-25 15:56:35 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. If you believe this pull request is incorrectly routed as waiting on the author, comment |
That's actually even more incorrect. The expected instrumentation for the process entity could never tell at any given time that the detected executable for the process is the same as the path that it was launched with. It could be changed at any time. So the name is very misleading, and as written I don't think it should be on the entity.
But you still can't do that. Removing If you want to distinguish between two copies of an executable on the system (not just an executable, ANY kind of file) the only fundamentally correct way to do so is by that file's unique ID (inode on Linux, file index on Windows, etc). The path, or lack thereof, is never a good way to truly uniquely identify a file on an operating system.
I am only okay with the attribute |
| - ref: process.launch_path | ||
| role: descriptive | ||
| requirement_level: opt_in |
There was a problem hiding this comment.
I am not aware of any information in Linux (/proc filesystem) to retrieve the initial executable path for a given process/pid. The vale of process.executable.path can change over the process entity lifetime. In that sense, readlink the symbolick link in /proc/self/exe does not guarantee that it was the initial executable (execv syscall changes that value).
Any idea of how this will be retrieved?
There was a problem hiding this comment.
I am more than happy to loosen the note to remove initial hence it can be updated. In fact would run_path be a better name option for you that way can say it is path to what is running in the process.
There was a problem hiding this comment.
What would be the difference from using process.executable.path? The attribute is part of the process namespace, therefore it always depends on the running process (implicit that it might change over time).
That is fine & it is expected given this pr is not seeking to differentiate between 2 copies of the same file. I am well aware we need a more robust way to identify the instance of a file but out of scope for this pr.
If you are not a supporter of
It couldn't live on runtime as we end up back in the situation of the descriptive attribute belonging to a different item than the identity. Anyway That is a seperate discussion for a different pr. Key thing here is what should the attribute be called which describes the path to what is running in a process. |
My favourite option is to keep it named P.S. I think |
Then we have 2 usages/meanings for process.executable, what about process.executing_path or process.execution_path? That way it is clearly related to executable but not identical namespaces.
The problem is profiling needs to be able to get a name for the executable identified by the id. The options i see to improve things:
|
It's not really different. It is the path to the process's executable. It's about an executable. That's not ambiguous to me at all.
Not a fan of those; non-standard nomenclature, and could be very confusing. What we're trying to describe is "the path to the executable run by the process", so calling that "execution path" isn't exactly stating that clearly.
Yeah the |
Changes
This provides a solution to the recent discussion about the process.executable use case of where it is possible for multiple copies of the one executable residing on the one system.
The reason why the new attribute resides on the process entity is because a single process executable can be located at multiple different paths hence the difficulty in keeping it on the existing entity see https://cloud-native.slack.com/archives/C06QEG97W7L/p1776775889053099 which is connected to #3536 (comment)
Also by naming it launch_path we can better cater for scenarios where the executable is running a script and that is the source of the telemetry.
Important
Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.
Merge requirement checklist
[chore]