-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make pdata.LogsToOtlp and pdata.LogsFromOtlp impossible to call from outside this module #1703
Make pdata.LogsToOtlp and pdata.LogsFromOtlp impossible to call from outside this module #1703
Conversation
195006d
to
a4694aa
Compare
a4694aa
to
83361dc
Compare
Codecov Report
@@ Coverage Diff @@
## master #1703 +/- ##
==========================================
+ Coverage 92.17% 92.31% +0.14%
==========================================
Files 259 259
Lines 18402 18211 -191
==========================================
- Hits 16962 16812 -150
+ Misses 1013 987 -26
+ Partials 427 412 -15
Continue to review full report at Codecov.
|
This is necessary to prevent circular package dependency that can arise when we need to hide certain pdata functions in the internal package in a commit that is coming soon in open-telemetry#1703
This is necessary to prevent circular package dependency that can arise when we need to hide certain pdata functions in the internal package in a commit that is coming soon in #1703
83361dc
to
f0a882f
Compare
This is necessary to prevent circular package dependency that can arise when we need to hide certain pdata functions in the internal package in a commit that is coming soon in open-telemetry#1703
This is necessary to prevent circular package dependency that can arise when we need to hide certain pdata functions in the internal package in a commit that is coming soon in open-telemetry#1703
f0a882f
to
a59da19
Compare
This is necessary to prevent circular package dependency that can arise when we need to hide certain pdata functions in the internal package in a commit that is coming soon in #1703 Co-authored-by: Tigran Najaryan <[email protected]>
a59da19
to
8848fdc
Compare
@open-telemetry/collector-approvers I need a review/approval on this. |
…outside this module LogsToOtlp and LogsFromOtlp are intended to be used only by OTLP exporter (for which OTLP is the native data format) and fileexporter (for which we do want to output internal representation for debugging purposes). All other code is supposed to use public member functions of pdata.Logs struct. This changes makes it impossible to use LogsToOtlp and LogsFromOtlp outside this module by hiding them behind an intermediary struct that is declared in an internal package. This is necessary to prevent accidental use of LogsToOtlp and LogsFromOtlp and the OTLP data structs, which we prohibit to do since the OTLP data structs may change in the future.
8848fdc
to
07db553
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.
LGTM
* Add Valid method to KeyValue * Use KeyValue.Valid in attribute add on Span * Resource StringDetector errors for invalid attribute * Ignore invalid attr in NewWithAttributes The OpenTelemetry specification requires attributes conform to a standard evaluated and returned by attribute.KeyValue.Valid. To comply with the specification, Resources created from NewWithAttributes need to only contain valid attributes. This adds a check to ensure this and drops invalid attributes passed as arguments. * Add changes to changelog * Add nolint comment The attribute.Set is (possibly overly) optimized to avoid allocations. The returned value from the constructor is a value of a Set, not a pointer to the Set. A Set contains a lock value and pointer methods so passing the Set value raises the copylock go vet error. This copies the same nolint comment from the `NewSet` method this used to use. * Apply suggestions from code review Co-authored-by: Sam Xie <[email protected]> Co-authored-by: Sam Xie <[email protected]>
LogsToOtlp and LogsFromOtlp are intended to be used only by OTLP exporter (for which
OTLP is the native data format) and fileexporter (for which we do want to output internal
representation for debugging purposes).
All other code is supposed to use public member functions of pdata.Logs struct.
This changes makes it impossible to use LogsToOtlp and LogsFromOtlp outside this module
by hiding them behind an intermediary struct that is declared in an internal package.
This is necessary to prevent accidental use of LogsToOtlp and LogsFromOtlp and the OTLP
data structs, which we prohibit to do since the OTLP data structs may change in the
future.