class TestService(test_pb2_grpc.SpeechToTextService):
async def Method(self, request: Request, context: grpc.aio.ServicerContext):
start = time.time()
value= request.value
...
result = long_process(value)
...
return Response(result = result, duration=time.time()-start)
response = requests.post(
"http://localhost:8557/api/v1/test", json=data)
print("Получен ответ:")
print(json.loads(json.loads(response.content))) #норм
print(response.content.decode("utf-8")) #"{\n \"text\": \"\\u0441\\u0430...
[sentry] DEBUG: Flushing HTTP transport
[sentry] DEBUG: background worker got flush request
[sentry] DEBUG: Sending envelope [envelope with 1 items (transaction)] project:1 host:<host>
[sentry] DEBUG: [Tracing] Adding `sentry-trace` header <long id> to outgoing request to https://<host>/api/68/envelope/.
[sentry] ERROR: Unexpected status code: 403 (body: b'<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n')
[sentry] DEBUG: Sending envelope [envelope with 1 items (internal)] project:1 host:<host>*
[sentry] DEBUG: [Tracing] Adding `sentry-trace` header <long id>- to outgoing request to https://<host>/api/1/envelope/.
| [sentry] ERROR: Unexpected status code: 403
transaction = sentry_sdk.Hub.current.scope.transaction
with transaction.start_child(op="task_method"): # equivalent to `sentry_sdk.start_span`
response = do_task(request)
span = sentry_sdk.Hub.current.scope.span
if span is None:
# no span in progress, create new transaction
with sentry_sdk.start_transaction(name="task"):
do_task()
else:
# new task span as child of current span
with span.start_child(op="task"):
do_task()
?FROM nginx
COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf