-
Notifications
You must be signed in to change notification settings - Fork 237
Serverless instrumentation #716
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
This function appears to have been replaced by Client.queue() anywhere that it actually matters. I can't find any code paths that actually use this function, which further makes DummyClient useless.
The http transport has wandered from the parent Transport class
I also let black restructure this file. I don't see anything semantically different with black's version and it does look nicer.
We're going to need context helpers and the like, makes sense for it to live in its own area
beniwohli
left a comment
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.
Great stuff!
| from elasticapm.conf import setup_logging # noqa: F401 | ||
| from elasticapm.contrib.serverless import capture_serverless # noqa: F401 | ||
| from elasticapm.instrumentation.control import instrument, uninstrument # noqa: F401 | ||
| from elasticapm.traces import ( # noqa: F401 |
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.
IIRC, last time I did this, all our linters got into a kerfuffle. I think it was black and flake8 duking it out
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.
As far as I can tell, both are running on that file in my IDE and both are happy. Took some experimentation as to the location of the # noqa: F401 line (which is why I know both were running).
Could you try checking it out and see if your IDE gives you problems?
Since it's (usually) just `$LATEST`, it's not useful for annotations
This is already included in the framework_name (and the runtime info)
If it's relevant to a given user they can collect it as custom context or we can add it (config-gated) later
|
Closing for now. We will probably go a different direction (via Lambda extensions) |
What does this pull request do?
Adds support for instrumenting serverless functions. Logs to CloudWatch so that those logs can be collected and sent to the APM Server later. Disables all background threads.
Note: This "works", but isn't useful without the connecting lambda from CloudWatch to the APM Server. Thus the lack of docs or references to this code.
Related issues
Ref #428