-
Notifications
You must be signed in to change notification settings - Fork 35
Create proxy transasction if not reported by agent #337
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
Conversation
logsapi/option.go
Outdated
|
||
// WithBatch configures a batch to be used for batching data | ||
// before sending to APM Server. | ||
func WithBatch(batch *accumulator.Batch) ClientOption { |
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 we need to pass some kind of callback in, maybe make it an interface (or interfaces)? That would remove the direct dependency on accumulator.
I wonder if we should just move ProcessLogs out of this package though, and into package app.
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 we need to pass some kind of callback in, maybe make it an interface (or interfaces)? That would remove the direct dependency on accumulator.
Thanks for the tip, I have added an interface to remove accumulator dependency on logsapi.
I wonder if we should just move ProcessLogs out of this package though, and into package app.
This sounds worth trying. I can give it a try with the PR to remove the buffer from logsapi or do you think we should address it in this PR itself?
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.
Doing it in a separate PR sounds good.
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 looks good to me now.
The approach you've taken of sending a partial transaction is quite similar to what @felixbarny suggested with the transaction-start
event, and looks good. I still think it could be useful to send the whole payload to the extension and have it parse it, but that's a lot more work and can be deferred until/unless we need it. Maybe specifying a Content-Type would help us handle that change gracefully.
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.
LGTM, just one other minor comment.
Tested extension on main branch (commit 3032883), with ESS 8.6.0 and a PoC that takes a param to decide whether it times out. Not all timed out calls are recorded in ES. Will have to investigate. |
Tested extension on main branch with ESS 8.6.0 and PoC with go agent on branch https://github.com/lahsivjar/apm-agent-go/tree/1323-lambdatxn This PR is working well. Timed out requests will report |
Motivation
Create proxy transactions if agent is not able to report the transaction due to unexpected errors like
OutOfMemory
.Related issues
Part of #315
Testing
(Currently, the PoC for agents is implemented only in golang so the lambda function must use go1.x runtime)
event.outcome: failure
.The above steps can also be executed using the
testing/benchmarking
module by editing the test function (same as this example).