-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
changes to get ray serve responding on REST API calls when distribute… #49730
base: releases/2.40.0
Are you sure you want to change the base?
changes to get ray serve responding on REST API calls when distribute… #49730
Conversation
…d tracing is enabled
@@ -0,0 +1,364 @@ | |||
# from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor |
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.
FastAPIInstrumentor instrumentation was not working and was throwing errors so I added to add this.
This is taken from https://github.com/anyscale/tracing-example/blob/main/fp.py
|
||
|
||
@serve.deployment(num_replicas=1, ray_actor_options={"num_cpus": 0.2, "num_gpus": 0}) | ||
@_inject_tracing_into_class |
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.
Also, we have to do this injection on all the serve deployments or else we get the same error described in the issue, where it complains with the following error.
TypeError: got an unexpected keyword argument '_ray_trace_ctx'
@@ -0,0 +1,33 @@ | |||
from starlette.requests import Request |
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.
Added this example to show that on all the serve deployments we have to do tracing injection and see the comment below.
to deploy and test do the following..
ray start '--resources={"no_gpu": 100}' --head --port 7990 --tracing-startup-hook ray.util.tracing.setup_tempo_tracing:setup_tracing
and then
serve run test_tracing_with_deployment:translator_app
and send traffic as shown in the below example.
curl -X POST -H "Content-Type: application/json" -d '"Hello, how are you?"' http://127.0.0.1:8000/
…d tracing is enabled
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.