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.
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
add process.name attribute and adapt process.executable.name #1737
base: main
Are you sure you want to change the base?
add process.name attribute and adapt process.executable.name #1737
Changes from 4 commits
e257619
ca5ad42
5a679fd
bb51157
cd4c335
32ee3f4
5630937
8c5ea47
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems
process.name
andprocess.executable.name
are always the same on windows - is it the case?In the spirit of T-shaped API, do you think it could be one of these linux-specific things? I.e.
process.linux.exe|exectuable.name
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this specification, it is the case that
process.name
andprocess.executable.name
will be the same on Windows. I dug as far as I could into Win32 and .NET APIs to see if there was ever a way to change a process's name at runtime like in Linux, and I could not find any way to do so. So I think it is fundamentally the case even outside of this specification that process name and executable name will always be the same on Windows.I think there is a good use-case for maintaining
process.executable.name
as a cross-platform name, and that's how it's used in CLI. In this case, it seems the way it's used is for the attribute to be the executable name on both Linux and Windows. On Linux this distinction matters, whereas on Windows it doesn't. However, this ensures that on either platform thecli.internal
span will always have a correct executable name, and doesn't need to worry about special attributes based on the platform.Perhaps I could add a note in
process.executable.name
's description that on Windows it will always be the same, and can be excluded if you're already usingprocess.name
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can generalize this a bit to be OS-agnostic?
So, can we just say that the two fields may have the same value?
That is often true on Linux and always true for current Windows versions and below.
It still makes sense for Windows clients to send both fields, otherwise there should be a written hint/rule like "if
process.name
isn't set, fallback toprocess.executable.name
" or the other way round.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use
process.executable.name
in CLI conventions because it was the only one that existed.The question I feel we should address:
If I have some instrumentation that would benefit from having a process name, but does not need a lot of details ("General Class") - which one of those attributes I should use? I'm going to say
process.name
is the first candidate just because it's shorter and looks very general.In this sense, I would even suggest to change
process.name
definition to be the best known name (yes, you can get it using OS APIs, but maybe you have a smart way to generate better process names, or maybe you want to record friendly process name when self-reporting it from within a process).Let me try to phrase it (will leave a separate comment with suggestion)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added suggestion in https://github.com/open-telemetry/semantic-conventions/pull/1737/files#r1913586365
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to have an example that's different between
process.name
andprocess.executable.name
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would be the best place for that? As part of this description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it as a note on
process.name
in cd4c335There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant if we could have realistic example that's different on linux in
examples: ['otelcol']
, it's minor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Linux, one example where the process name isn't changed programmatically is using a symbolic link, for example
ln -s foo bar
. Running./bar
gives youbar
from/proc/<PID>/comm
, but the basenamefoo
fromreadlink /proc/<PID>/exe
.A real example for this is
unlz4
which is a link to thelz4
executable (on my Debian system). So as you say in your suggestion,process.name
seems to be more relevant/precise here.Unfortunate, there are other examples where
process.name
needs to be combined withprocess.executable.path
:process.name
: UnicodeNameMap (in both cases)process.executable.name
: UnicodeNameMappingGenerator (in both cases)