Start implementation of new tracer API#631
Conversation
3c3c5df to
0626101
Compare
17f12fa to
c3660bc
Compare
|
@realark this should be ready for review now |
There was a problem hiding this comment.
Originally when we called it just Interceptor, it was inside the class it was intercepting. With it being stand-alone, it doesn't have that context in the name.
There was a problem hiding this comment.
We also now have single Interceptor class instead of multiple, so I kind of feel it makes sense to pull it out.
There was a problem hiding this comment.
I'd like to group things better into packages. This could probably be grouped with Clock into a single package.
There was a problem hiding this comment.
I was actually considering that along with some other 'repackaging' - i.e. I was thinking making an internal package to 'hide' all implementational stuff. And yeah, time related stuff can go into its own package. The only thing that prevents doing that currently is the fact that error reporting stuff is 'package private' and it would be invisible if we move that - so I was hoping to postpone this repackaging until we have logging/error reporting better ironed out. Objections?
There was a problem hiding this comment.
That's fine. I hate that java doesn't allow sub-packages to access parent package private stuff.
There was a problem hiding this comment.
Should we consider a builder pattern for Tracer instead of providing all these constructors?
There was a problem hiding this comment.
We probably should have builder. There is more work needed on the tracer since we also need some reasonable way to gather up and provide all interceptors to it. Maybe this can be hashed out at later stages?
There was a problem hiding this comment.
Why does clock need to maintain a reference to the source tracer? Is this only so Timestamp can reportError?
There was a problem hiding this comment.
Yes, right now that is the only reason.
There was a problem hiding this comment.
I think we might need to have some sort of rate limiting on these kind of log messages as a misbehaving integration could easily cause a machine to fill up it's disk.
There was a problem hiding this comment.
I was planning to do a second iteration over this whole error/warning reporting part, so yeah having ratelimiting is a good idea, but maybe it can be left for another PR?
There was a problem hiding this comment.
This is interesting... what does this do?
There was a problem hiding this comment.
The general idea in EqualsVerifier is to make sure that class adheres to 'standard' equals/hashCode contract. We have to disable some stuff - in this case we do not declare Clock final so we disable checks related to potential Clocks child classes.
There was a problem hiding this comment.
Cool. Didn't know you could add comments to the when/then blocks.
realark
left a comment
There was a problem hiding this comment.
(Still reading through this. Thoughts so far)
There was a problem hiding this comment.
👍
This is great. agent-bootstrap will be a great way to share internal tools to instrumentation and the core tracer. I added the project to list of potential renames (since it's more of a general util at this point and not agent-specific.
There was a problem hiding this comment.
I'm okay with using finalizers, but given this caveat we should wrap them try - catch(Throwable) to ensure we don't miss errors.
0447f90 to
c09418d
Compare
There was a problem hiding this comment.
With our new concept of invalid traces, can we remove the trace count incrementer and leave that up to the writer?
There was a problem hiding this comment.
Yeah, I've tried that. And then @tylerbenson had pointed out that we still need to count traces that have been discarded by sampler.
realark
left a comment
There was a problem hiding this comment.
Looks good! Left a few small suggestions.
c09418d to
11fce64
Compare
This mainly implements Span, Trace and Continuation logic.
11fce64 to
3fb98ea
Compare
There are still quite a few TODOs and work left in general, but this seems to be a reasonable 'stopping point' to start reviewing these changes.