-
Notifications
You must be signed in to change notification settings - Fork 44
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
Providing Activity/Fragment name in the span name #211
Comments
The fragment/activity name should be an attribute on the span though. This is a good candidate for us to solidify as semantic convention, IMO: Span naming for activity/fragment creation. |
That's ok for me, though it would still be helpful to mention something about it in the span name as well.
Sounds good, I think it might be worth mentioning it in the Client SIG as well. |
Something to consider is that the Fragments are obfuscated IIRC (Activities are not), so inferring the name from the class name is suboptimal. The other option is to symbolicate the fragment's name on the server, far from ideal for a vendor-agnostic lib. |
That's a great point, we definitely need to find alternatives to just getting the class name at runtime. |
Agree, I think we can use Datadog RUM's approach where the user defines Activity/Fragment during initialization. For example: val rumConfig = RuntimeConfig.rumConfigBuilder()
.useViewTrackingStrategy(FragmentViewTrackingStrategy(
predicate = object : ComponentPredicate<Fragment> {
override fun accept(component: Fragment): Boolean {
return allowedFragments.contains(component)
}
override fun getViewName(component: Fragment): String? {
when (component) {
is LoginFragment -> "Login Fragment"
is HomeFragment -> "Home Fragment"
else -> "Default Fragment"
}
}
}
))
.build() |
Yep, that's exactly what I'd suggest |
Currently, the
ActivityTracer
andFragmentTracer
tools create spans with only the verb as name, which causes too low cardinality when analyzing the data later on. For example, the screenshot below shows how a span of an Activity creation, followed by 2 fragment creations as children, looks like right now:Analyzing this data might become more straightforward to do if the name of the Activity/Fragment would appear in the span name, for example:
The text was updated successfully, but these errors were encountered: