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
Implement default type fallback #2525
Conversation
/test |
protected String normalizeType(@Nullable String type) { | ||
if (type == null || type.isEmpty()) { | ||
return "custom"; | ||
} | ||
return type; | ||
} |
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.
[minor] proposal - do that in a base implementation for beforeEnd()
instead and call super.beforeEnd()
in children
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.
I suggest to do it without any sub-classing: by moving the type
attribute directly into AbstractSpan
, while the field value has different semantics in Transaction
and Span
this makes sense and allows to keep this normalization private in AbstractSpan
.
I'll push an implementation of this in this PR, let me know if that would be a good fit here.
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.
Not sure. Why was it in the subclass in the first place? Is it because of the volatility requirement in case of transactions and not in case of spans (not sure why)? Maybe there was a reason for this separation.
I assumed it was in the base class when proposing that
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.
I really don't know why it was like this in the first place, doing some git archaeology it has been like this since 2018.
Maybe @felixbarny remember something about having two distinct fields and one of them being volatile
, as this is not urgent we can definitely discuss this during next weekly meeting.
What does this PR do?
Implements elastic/apm#602
Checklist