-
Notifications
You must be signed in to change notification settings - Fork 889
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
process.command_line accepts multiple value types #831
Comments
This was intentional and was discussed at #635 (comment). In some environments (Windows) a single string (space separated or however it was typed in the shell) is the raw form of this. In others (Linux) a NUL-separated string that is easily translated to a list is the raw form. Additionally, some runtimes support only obtaining the commandline as list of arguments, which would need to be escaped (according to which shell's syntax?) if you want them as single string. |
Actually, a much nicer summary of the pros & cons is at #635 (comment) by @james-bebbington :
|
Yeah I can definitely see the motivation for this. At the same time, instrumentation and backend does get quite a bit more complex because of the dual-type so I don't know if this will be easy to implement - generating code from the semantic spec yaml seems especially problematic. @thisthat Can you check if your semantic spans work be able to cover this case? #571 |
Instrumentation gets simpler because it has a choice, and can do whatever is easier. Or am I missing something? |
I see - currently in Java we use an abstraction like |
You can also have two constants for this semantic attribute, e.g. a StringAttributeSetter PROCESS_COMMANDLINE_STR and PROCESS_COMMANDLINE_LIST. Though I begin to see your point. We could instead have two alternative semantic attributes with two different names in the semantic conventions. It would be a bit clunky in the spec then though. |
Anyways it's a very small point - I was surprised to see it but since it was already discussed it's fine with me. Thanks for clarifying it. |
Actually let me keep this open. The spec text says either primitive or array So I think we need to tweak that to more formalize the possibility of union types. |
The actual Attribute will not have an union type, it will have either one or the other type. Only the semantic convention has the union type. |
It took me a minute to parse that but I understand what you mean :) It's true, but I don't think it hurts to clarify this example explicitly. I think dual type convention is going to cause confusion when a newcomer reads and tries to understand so we can probably help. That newcomer this time was me, hence the issue filed ;) |
I might miss something but, what is the reason for not using array as the only available type and in windows put it as a single element array? |
@thisthat I think the opposite argument could also be made. Why not convert the array representation into a string in the backend, if it's so important to have a consistent type? @Oberon00 wrote:
and I agree. I don't think OTel should be in the business of saying what is and is not a valid data representation for these semantic conventions. The conventions are describing semantics. There is no loss of semantics by allowing multiple representations, but there are well-documented benefits to the instrumentation modules that can simply observe their inputs as opposed to transforming their inputs to match a specified data representation. |
I'm not against having conventions with multiple types like this if we clearly lay it out. I'm not sure I'd go so far as saying we aren't in the business of describing the data representation though. If we are ok with numeric values being reported as strings, for example, all processors of data whether collector or backend would have to check both types or risk missing the data, which is unnecessary complexity. |
Because the meaning of a single array element currently is: After splitting the argument list, this was the only argument. E.g. when you have a value of |
@open-telemetry/technical-committee I think this issue should be allowed-for-ga. EDIT: I made a PR #1137 that would fix this. |
from the spec sig mtg today, re-triaged for allowed-for-ga |
I noticed
process.command_line
accepts different types of values. I don't think we generally do this but was this intended? I would just use a string for it in all cases.https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/process.md#process
The text was updated successfully, but these errors were encountered: