-
Notifications
You must be signed in to change notification settings - Fork 182
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
Don't use gateway provided requestID for trickle URLs #3408
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3408 +/- ##
===================================================
- Coverage 32.11405% 32.07404% -0.04001%
===================================================
Files 147 147
Lines 40789 40843 +54
===================================================
+ Hits 13099 13100 +1
- Misses 26916 26969 +53
Partials 774 774
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
We probably want to add the orch-generated requestID to the orch logging context and return it to the gateway to add to its own context. That way we can filter logs by a specific G-O pair which will come in handy once we do O swapping.
Alternatively, when we construct the mid
part of the trickle URL we can make it something like requestID + "-" + gatewayRequestID
. I believe we log the full trickle URL in most contexts so that would probably work OK if filtering for a partial match.
@j0sh I've made a change to include the orch request ID in the logs, I'm thinking we continue to use the gateway requestID as the common ID across all apps to make filtering easy (Evan will be using this), and then also add the other app requestIDs with other field names i.e. We could also rename |
@j0sh Also makes sense to return the orch requestID to the gateway. cc @victorges @leszko if we want to return the orch requestID to the gateway, does it seem ok to add that field to the response body or should it be a response header? |
@mjh1 I am fine with renaming it. But we decided on using the stream_id as the common id across logs because it's the only ID that is available everywhere. For example, the request id is not available to the front end apps. Additionally, all investigations start with a front-end stream id and then have to be translated into a request id - it's simpler to avoid this translation. |
Though I also like your recommendation here. We are essentially creating a hierarchy of ids and doing this will make tracing much easier
|
If we're returning the orch request ID to the gateway, why not also send it to the runner as well? I assume that implies putting it in the body. (I think we should also have included the gateway request ID in the body as well; not sure why we are putting data into untyped headers.) BTW we don't have to do this if we set the |
Isn't the requestID already included in the response body, inside We could include another field in the response body, but the problem is that it's already pretty bad design, this API was design as a sync API to pass data from G into R, but we actually re-use it for fields exchanged between G<>O. So, I'd try to not there anything more than we really need and in the future, re-design it at all. |
@leszko Yes the request ID is in the trickle URL and that is probably OK (since we usually print the full trickle URL / path in logs) but we would want to make the What I would not do is assume anything about the structure of the trickle URL, eg this function is not a good idea and will cause problems whenever we need to change the URL. We have the ability to send properly structured fields, let's use them.
Yes it is a little annoying in that we sometimes need to send different data back to the G vs the R. But I don't think this is such a case, because if we send the orch request ID back to the gateway to add to its logging context, we should also send it to the runner. That being said, I am not sure what the harm is in extending the response body to do what we need it to. Make the fields optional if we have to. Otherwise, why use a schema at all? |
Fine, I'm ok with extending the schema. Leave it to @mjh1 to decide. |
ControlUrl: &controlUrlOverwrite, | ||
Params: req.Params, | ||
GatewayRequestId: &gatewayRequestID, | ||
StreamId: &streamID, |
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.
Should we also add the orchestrator generated requestID as well?
// local AIWorker processes job if combined orchestrator/ai worker | ||
if orch.node.AIWorker != nil { | ||
workerResp, err := orch.node.LiveVideoToVideo(ctx, requestID, streamID, req) | ||
workerResp, err := orch.node.LiveVideoToVideo(ctx, gatewayRequestID, streamID, req) |
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.
I am a little confused why these additional parameters are needed if they are now in the req
?
Switch back to using generated requestID for trickle URLs and set the gateway request ID as its own logging field.