chore: clean up span naming#162
chore: clean up span naming#162obecny merged 3 commits intoopen-telemetry:masterfrom johnbley:master
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
=======================================
Coverage 94.10% 94.10%
=======================================
Files 74 74
Lines 3582 3582
Branches 387 387
=======================================
Hits 3371 3371
Misses 211 211
|
|
@johnbley Is there a plan to do the same for |
Yes, working my way through a number of smaller issues like this. Doing one area at a time to not overwhelm the maintainers. 😄 |
|
@obecny particularly looking for your feedback on this one |
| /** | ||
| * Controls whether or not to create a span, based on the event type. | ||
| */ | ||
| protected allowEventType(eventType: string): boolean { |
There was a problem hiding this comment.
this should be private as it is not used by any subclass?
Prefix protected and private methods with _
There was a problem hiding this comment.
I wanted to leave a way for users to specialize their own list of "interesting enough" events (possibly even dynamic, unlike with a config item). If that's not cool I can make it private. Either way I'll prefix with _.
There was a problem hiding this comment.
By writing an instrumentation module which extends ours? that is an interesting idea.
There was a problem hiding this comment.
Also: perhaps the lint rules could be expanded to enforce the naming?
obecny
left a comment
There was a problem hiding this comment.
We can either add such possibility to a plugin config. This can be a 2 callbacks
{
allowEventType(eventType: string) {
if (eventType === ....) { // write your own logic
return true;
}
},
updateSpanName(target: HTMLElement) {
// write your own logic
return 'spanName';
}
}
By default I would support click event only
For event better convenience the plugin could have the 2 public methods with the same name that can be simply override. This way it would allow you to create a plugin without necessity of configuration. Such solution would satisfy anyone then and would allow much more customisation
Sorry, not understanding this. You would like
Will do. |
I meant when you instantiate plugin and 2nd possibility |
This (strongly typed) is my preference - easier for IDEs, static tools, etc. to analyze/understand the specialization. That's what the current patch uses. |
dyladan
left a comment
There was a problem hiding this comment.
I like the simpler names, and the xpath is still available as an attribute if needed. The use-case for the protected method seems valid to me and anyway there is no way to make a method truly private in JS anyways without jumping through crazy hoops.
dblclickas well asclick