-
Notifications
You must be signed in to change notification settings - Fork 61
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
RUMM-1153: Possibility to attach custom attributes to automatically collected RUM Resource events #520
Conversation
…rce event ended with error
*/ | ||
open class DatadogInterceptor | ||
internal constructor( | ||
tracedHosts: List<String>, | ||
tracedRequestListener: TracedRequestListener, | ||
firstPartyHostDetector: FirstPartyHostDetector, | ||
private val rumResourceAttributesProvider: RumResourceAttributesProvider = |
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.
it is not last in the argument list to keep lambda last to still have ctor() { lambda }
syntax
.substringBeforeLast('.') | ||
val noOpReturnType = ClassName(packageName, "NoOp${returnTypeDef.simpleName}") | ||
funSpecBuilder.addStatement("return %T()", noOpReturnType) | ||
val returnTypeElement = returnTypeDef as TypeElement |
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.
Nicely done
sample/kotlin/src/main/kotlin/com/datadog/android/sample/SampleApplication.kt
Outdated
Show resolved
Hide resolved
dd-sdk-android/src/test/kotlin/com/datadog/android/DatadogInterceptorTest.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #520 +/- ##
============================================
- Coverage 89.49% 89.40% -0.09%
+ Complexity 1455 1451 -4
============================================
Files 167 167
Lines 5015 5030 +15
Branches 583 583
============================================
+ Hits 4488 4497 +9
- Misses 336 341 +5
- Partials 191 192 +1 |
…atically collected RUM Resources
6b40763
to
d84e2a8
Compare
|
||
@RunWith(AndroidJUnit4::class) | ||
@LargeTest | ||
internal class ResourceTrackingTest { |
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.
very nice !!
...ation/src/androidTest/kotlin/com/datadog/android/sdk/integration/rum/ResourceTrackingTest.kt
Outdated
Show resolved
Hide resolved
419136d
to
889f8c6
Compare
What does this PR do?
This change gives user a possibility to attach custom attributes to automatically collected RUM Resource events: either in the
OkHttp
flow, or in theWebView
flow.Attributes are collected after the resource call is completed (with either
success
orerror
outcome)Additional Notes
Resources are also automatically collected here, but this part is not covered by this PR, because this class is low level and not sure if it is needed. Can be addressed in another PR if needed though.
Review checklist (to be filled by reviewers)