-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pdata] Add documentation defining naming conventions #6255
Conversation
Codecov ReportBase: 92.48% // Head: 92.48% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #6255 +/- ##
=======================================
Coverage 92.48% 92.48%
=======================================
Files 218 218
Lines 13124 13124
=======================================
Hits 12138 12138
Misses 769 769
Partials 217 217 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
86413a3
to
9e948b9
Compare
@open-telemetry/collector-approvers PTAL |
bb13b8d
to
e3f3eb1
Compare
e3f3eb1
to
daef695
Compare
b3c896b
to
b2dd7d2
Compare
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.
I think it is useful to document the design principles of pdata API, but I think it would be beneficial to remove from this document the parts which are already codified in the pdata generator to avoid the need to maintain the document if the generator is changed in any way.
- `plog.Logs` based on `LogsData` protobuf message. | ||
- `pmetric.Metrics` based on `MetricsData` protobuf message. | ||
- `ptrace.Traces` based on `TracesData` protobuf message. | ||
- `pcommon.Slice` based on `ArrayValue` protobuf message. | ||
- `pcommon.Map` based on `KeyValueList` protobuf message. | ||
- `pcommon.Value` based on `AnyValue` protobuf message. |
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 better to delete all these lines and only keep one exception example, to reduce the amount of maintenance this document requires if the source code is refactored? Let the source code be the source of truth. If you want the fact of the exception to be documented it would be better to add a comment in the source code near the 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.
Makes sense. Removed
b2dd7d2
to
a76c1b9
Compare
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.
Please document all exceptions, see comment
#6283 (comment)
We had the struct name exceptions listed in this document initially. @tigrannajaryan suggested to not list them all, but use the code as source of truth #6255 (comment). If we want to document field name exceptions, I believe we should do the same for the structs. So the question is where we document the exceptions: source code comments or this Readme file. Using the readme adds maintenance burden as Tigran pointed out. But I don't like putting them into the comments because the comments are intended for API users who probably don't care why particular type or field is called one way or another. So I would rather list them here, and I don't think it'll be a lot of them going forward to bother us with keeping it in sync. |
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
a76c1b9
to
aeccca5
Compare
@bogdandrutu, I mentioned all the naming exceptions in this doc |
Not perfect, but a great start :) Thanks @dmitryax |
The documentation is intended to summarize all the naming rules followed in pdata module