-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
logtest: Add Recorder #5134
logtest: Add Recorder #5134
Conversation
The links failure is expected, as the README currently points to a missing package. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5134 +/- ##
=====================================
Coverage 83.8% 83.9%
=====================================
Files 254 255 +1
Lines 16539 16596 +57
=====================================
+ Hits 13872 13927 +55
- Misses 2374 2376 +2
Partials 293 293
|
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.
Bridges should not depend on the SDK.
I would rather prefer to have logtest
with something like: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/d15fe4f317e0376ff4a65a435b785a1c88e11b7c/bridges/otelslog/handler_test.go#L35-L76.
I think we could consider adding it to the go.opentelemetry.io/otel/log
module (as go.opentelemetry.io/otel/log/logtest
package) because one using the Bridge API would most likely would like to test the bridge implementation using this logtest
package. Then we would not need to create test
modules like https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/net/http/otelhttp/test/doc.go.
Related comment: open-telemetry/opentelemetry-go-contrib#5279 (comment)
8b23c86
to
7455f59
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.
🎉
Co-authored-by: Robert Pająk <pellared@hotmail.com>
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.
Only non-nit is the comment about enabledFn
.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@MadVikingGod, @dashpole, @XSAM, can you please review as it touches the API module? |
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.
Looks good overall
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.
Optional suggestion
This adds a
Recorder
into a newlogtest
log package, with the purpose of avoiding code repetition in each log bridge tests.