-
Notifications
You must be signed in to change notification settings - Fork 895
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
Semantic Conventions for File Attributes #1772
Comments
Hey @djaglowski!
|
I think we need to have one "semantic conventions" set of documents and label each individual semantic convention with up to 4 possible labels which indicate which signal/data type the convention is applicable to: |
Can we come up with a better name? FYI, Elastic Common Schema has a
Why would it be a different semantic? For example if I do some sort of file processing and want to report it as a span wouldn't it be a good fit to specify |
If these file conventions can be designed to be used in span and log attributes with the same semantics, that would be ideal IMHO, and the using the file namespace seems best. |
@arminru can you please comment on this ^^^? |
If we want to add this as a generic attribute which always describes the file about which a certain span, log or metric is about, then |
Based on discussion in the Spec SIG, I'm suggesting the following approach: First, the immediate problem can be considered as a logs-specific attribute set. This would mean prefixing the above attributes, such that we would have:
Second, as a possible separate proposal, the notion of establishing a "structured value" should be explored. The general idea would be that a common structure could be established that is reusable in multiple contexts within the project's semantic conventions. In the context of a log source, the semantic convention would establish that the
A mechanism for defining and referring to structured values would then facilitate commonality across the semantic conventions by allowing reuse. Referencing this type in a specification would then logically produce a corresponding set of attributes. Logically:
would effectively define
With this second point in mind, the logs-specific attribute set would ideally be defined in such as way that it is broadly applicable, such that an eventual structured value for describing a file could replace the initial logs-specific attributes in a non-breaking way. Of course this cannot be guaranteed, but we can make a point to consider whether these attributes would be broadly useful. I am satisfied that they are, but I'm calling this out in case anyone has further thoughts on this before we move forward. |
This likely requires an OTEP since it has significant implications (the Trace API currently disallows structured values, except the most simple ones - homogeneous arrays). |
I may have misunderstood what you wrote. Do you suggest that we do this (in JS notation for simplicity): attributes["some_context"] = {
"file.name": "abc",
"file.path": "/var/lib/abc",
...
} or this: attributes["some_context.file.name"] = "abc"
attributes["some_context.file.path"] = "/var/lib/abc"
... |
@tigrannajaryan I was imagining the latter, but really only because the existing conventions use string keys, as far as I've seen. Having thought about it more (and a good thing - see below), I am even more in favor of the string-only approach. The rules for attribute naming, specifically the third and fourth, ensure that the two formats are effectively interchangeable. If I'm correct on that point then it seems we might as well decide based on simplicity and compatibility. I would also say that I'm less convinced of the need for any kind of code-level support of structured values, though I still think it would be good to formalize some notion of what I would call "relative namespaces" (e.g. I'm really glad you asked this because thinking about the extent to which the two representations are almost interchangeable w/o any rules helped me recognize that my own proposal seemed to demonstrate a case in which they are not. Then I found the attribute naming rules and particularly that Adjusting for this, I now propose the following strings:
|
The proposal in your last comment sounds great to me, @djaglowski. Thanks for iterating on this. |
@arminru, I'll make the PR |
When consuming logs from a file, information about the file is commonly included as metadata on the log record.
As a starting point for discussion, I propose:
file.*
namespace:file.name
- The basename of the file (i.e.mylog.log
).file.path
- The absolute path of the file (i.e./var/log/mylog.log
).file.name.resolved
- Same asfile.name
, but with symlinks resolved.file.path.resolved
- Same asfile.name
, but with symlinks resolved.file.stream
- When relevant,stdout
orstderr
.The text was updated successfully, but these errors were encountered: