Skip to content

Conversation

@basepi
Copy link
Contributor

@basepi basepi commented Feb 13, 2020

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

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
@basepi basepi marked this pull request as ready for review February 20, 2020 23:28
@basepi basepi requested a review from beniwohli February 20, 2020 23:28
Copy link
Contributor

@beniwohli beniwohli left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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?

@basepi
Copy link
Contributor Author

basepi commented Jan 7, 2021

Closing for now. We will probably go a different direction (via Lambda extensions)

@basepi basepi closed this Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants