Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What and why?
📦 With this PR it is possible to send logs from a span:
How?
Technically, logs are linked to the span by the server, when this two internal attributes are provided:
With small refactoring, I was able to fully reuse the Logging feature from
DDTracer
🏅. The thin features integration layer was introduced:I've put this
TracingToLoggingOutput
inFeaturesIntegration
group, so we separate both features on the project level:Because now the Tracing feature uses the storage stack from the Logging feature, it was reflected in the
TracingFeature
initializer ✨:// TracingFeature init( directory: Directory, configuration: Datadog.ValidConfiguration, performance: PerformancePreset, + loggingFeatureStorage: LoggingFeature.Storage, mobileDevice: MobileDevice, httpClient: HTTPClient, ) { /* ... */ }
Refactoring
This integration required a refactoring of the Logging feature, so that the log date is no longer created by the
LogBuilder
. This responsibility was moved to theLogger
. This is because the Open Tracing API enables the user to specify the logtimestamp
explicitly:This is even better for the overall Logging architecture, as now the
Logger
becomes a "thin facade" for preparing the log's traits before passing them further to theLogFileOutput
for doing the "heavy" work.Testing
Beside unit tests for "create log for Tracing", I also added required integration test. Now the "Send traces for UI Tests" fixture not only sends spans, but also adds log to the "data downloading". Both, spans and logs delivery to
HTTPServerMock
is asserted inTracingIntegrationTests
🚀.Review checklist