-
Notifications
You must be signed in to change notification settings - Fork 219
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
Support grpc Server & Client (WIP) #862
Conversation
def request_started(self, handler_call_details): | ||
meta_data = handler_call_details.invocation_metadata[0]._asdict() | ||
trace_parent = TraceParent.from_headers(meta_data) | ||
method = handler_call_details.method |
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.
local variable 'method' is assigned to but never used
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.
fixed
should be a callable object that follow: | ||
Callable[str] -> bool | ||
""" | ||
def __init__(self, client=None, client_cls=Client, logging=False, config={}, **defaults): |
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.
Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
from elasticapm.contrib.flask.utils import get_data_from_request, get_data_from_response | ||
from elasticapm.handlers.logging import LoggingHandler | ||
from elasticapm.traces import execution_context | ||
from elasticapm.utils import build_name_with_http_method_prefix |
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.
'elasticapm.utils.build_name_with_http_method_prefix' imported but unused
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.
fixed
import elasticapm.instrumentation.control | ||
from elasticapm.base import Client | ||
from elasticapm.conf import constants, setup_logging | ||
from elasticapm.contrib.flask.utils import get_data_from_request, get_data_from_response |
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.
'elasticapm.contrib.flask.utils.get_data_from_request' imported but unused
'elasticapm.contrib.flask.utils.get_data_from_response' imported but unused
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.
fixed
import elasticapm | ||
import elasticapm.instrumentation.control | ||
from elasticapm.base import Client | ||
from elasticapm.conf import constants, setup_logging |
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.
'elasticapm.conf.constants' imported but unused
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.
fixed
❕ Build Aborted
Expand to view the summary
Build stats
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
try: | ||
return self.with_transaction(handler_call_details, continuation) | ||
except Exception: | ||
logger.error("Exception during handle transaction", exc_info) |
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.
undefined name 'exc_info'
logger.error("Exception durinng handle request", exc_info=True) | ||
|
||
|
||
def request_finished(self, result): |
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.
too many blank lines (2)
] | ||
|
||
def call(self, module, method, wrapped, instance, args, kwargs): | ||
channel = instance |
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.
local variable 'channel' is assigned to but never used
Hi, I am care about this PR, how is going?[excited] |
I am also very interested in this PR. Is there anything we can do to get the ball rolling again @RyanKung @beniwohli |
Hi, when will this RP merge? |
Tried the code from this PR. My findings so far:
Asyncio and headers are easy to fix, but im not sure about the future. |
Sorry guys, I don't have enough time to finish this PR. |
What does this pull request do?
Emm, Support grpc server.
Related issues
#645