-
Notifications
You must be signed in to change notification settings - Fork 35
Use query param to intake API to signal that function completed #82
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
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
44c8394
to
77d6862
Compare
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.
Overall this looks simple and solid. I see we have a new FuncDone
property on the extension package that we're using as a signal only channel, and when this channel receives a message it indicates the function is done with execution.
We send a signal to this channel whenever we see a request to /intake/v2/events
that includes a flushed=true
query string parameter.
This should work. However, when I tested this against a real agent without the query param implemented the extension crashed and interfered with a Node.js Lambda function (causing it to return null
)
However we coordinate with the agents to get this query param in we should (probably?) ensure that lambda functions with older agents attached don't crash. (I've added a discussion topic to the next planning meeting)
Thanks for the review, @astorm. I'll try to reproduce the error and report back. |
2116fbd
to
3a0ce93
Compare
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.
Approving 👍
I ran a manual smoke test and the fallback code is working -- data's sent, the extension does not crash.
The query param checking/signaling code looks like it does what it needs to.
This PR adds a change to signal on a channel when it receives an intake request from an agent containing the query param "flushed=true".
We can change the name of the query param, if that's not clear enough.
As a fallback, it also signals if it receives a
runtimeDone
event from the logsapi.There are now three channels used to signal in main. The
AgentDoneSignal
signals that there was an intake request received withflushed=true
, theruntimeDoneSignal
channel signals that a runtimeDone event was received via the Logs API. ThefuncDone
channel is closed if a signal is received onAgentDoneSignal
orruntimeDoneSignal
.Closing that channel signals to the go routines posting apm data and processing logs API events that they can return.
Resolves #62