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
Do onTraceReleased asynchronously in groupbytraceprocessor #1808
Do onTraceReleased asynchronously in groupbytraceprocessor #1808
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1808 +/- ##
===========================================
+ Coverage 69.77% 89.83% +20.05%
===========================================
Files 34 378 +344
Lines 1532 18214 +16682
===========================================
+ Hits 1069 16362 +15293
- Misses 391 1388 +997
- Partials 72 464 +392
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Leaving a review here, but we do need to discuss the approach first.
// because last phase does not affect this processor anymore. | ||
go func() { | ||
if err := em.onTraceReleased(payload); err != nil { | ||
em.logger.Error("onTraceReleased failed", zap.Error(err)) |
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.
You'll need to include payload information to make this useful.
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 don't like the idea to log payload for every error. Just imagine that the following processor starts to fail on every trace. Btw the payload is ResourceSpans
, what profit do we get from logging pointers?
Ideally, this logger should be aggregate like in exporters to avoid spamming on failures
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.
Adding the traceID would be more than enough. You can also move it to Debug instead.
Ideally, this logger should be aggregate like in exporters to avoid spamming on failures
That's the main reason to use metrics for this, so that people know that something went wrong but still don't get flooded with error messages.
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.
People know, that something went wrong, but don't know what exactly. That's why every processor returns error - in my opinion it must be shown in logs. This is error indeed.
If it is needed, why don't you put traceID into the error? In my world error should be self-sustained
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.
If it is needed, why don't you put traceID into the error? In my world error should be self-sustained
That's what I'm requesting :-)
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 mean put it in the place where the error occured. Honestly, I don't see any profit in knowing traceID. At least in my cases with sampling I cannot do anything with ID
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.
And currently no traceID is logged for error. Don't think recovering traceID from []ResourceSpans
is the right move
Also did minor changes, which improve performance. Since the processing is one-threaded, this is really crucial |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@jpkrohling Could you take a look please? |
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'd prefer if this change contained only the changes that are subject to this PR. Apart from a missing test, this looks good.
@@ -25,7 +25,7 @@ import ( | |||
|
|||
type memoryStorage struct { | |||
sync.RWMutex | |||
content map[string][]pdata.ResourceSpans | |||
content map[[16]byte][]pdata.ResourceSpans |
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.
This can be pdata.TraceId, no?
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.
You're right, but I don't like this idea, because in case of changes in the model it will implicitly affect this processor. Current approach guarantees correctness
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.
Pretty much every processor and exporter that needs to deal with TraceID uses pdata.TraceId
, @bogdandrutu usually writes scripts that updates those places en masse.
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@jpkrohling review status? |
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.
Once it uses the TraceID in the storage, this is ready to be merged.
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@pkositsyn , are you interested in continuing with this one? We are very close here :-) |
Done |
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.
Ready to be merged on green!
* Authentication processor 1/4 - Add configauth Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> * Authentication processor 2/4 - Add auth context and interface Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
The initialization options of the exporter are not used after the Exporter is created. Stop saving them in a field.
Description:
fixing a bug, when this processor could be overloaded.
Link to tracking Issue: #1807
Testing:
Added test for checking nonblocking
onTraceReleased
Documentation:
Changed the metrics description