Skip to content

Commit

Permalink
server: Add orch info on AI events (#3321)
Browse files Browse the repository at this point in the history
* server: Add orch info on AI events

* Change log
  • Loading branch information
victorges authored Dec 16, 2024
1 parent e497fab commit df2ed58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### General

#### Broadcaster
- [#3321](https://github.com/livepeer/go-livepeer/pull/3321) Add orchestrator info on live AI monitoring events

#### Orchestrator

Expand Down
8 changes: 7 additions & 1 deletion server/ai_live_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func startControlPublish(control *url.URL, params aiRequestParams) {
}()
}

func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestParams) {
func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestParams, sess *AISession) {
subscriber := trickle.NewTrickleSubscriber(url.String())
stream := params.liveParams.stream
streamId := params.liveParams.streamID
Expand Down Expand Up @@ -233,6 +233,12 @@ func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestPar
event["stream_id"] = streamId
event["request_id"] = params.liveParams.requestID
event["pipeline_id"] = params.liveParams.pipelineID
if sess != nil {
event["orchestrator_info"] = map[string]interface{}{
"address": sess.Address(),
"url": sess.Transcoder(),
}
}

clog.Infof(ctx, "Received event for stream=%s event=%+v", stream, event)

Expand Down
2 changes: 1 addition & 1 deletion server/ai_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func submitLiveVideoToVideo(ctx context.Context, params aiRequestParams, sess *A
startControlPublish(control, params)
startTricklePublish(ctx, pub, params, sess)
startTrickleSubscribe(ctx, sub, params)
startEventsSubscribe(ctx, events, params)
startEventsSubscribe(ctx, events, params, sess)
return resp, nil
}

Expand Down

0 comments on commit df2ed58

Please sign in to comment.