-
Notifications
You must be signed in to change notification settings - Fork 1
Send analytics logs to Kafka #1157
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
Conversation
victorges
left a comment
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.
LGTM
Co-authored-by: Victor Elias <victor@livepeer.org>
| sumRebufferRate += mv.sumRebufferRate / float64(mv.count) | ||
| var msgs []kafka.Message | ||
| for _, d := range p.logs { | ||
| key, err := json.Marshal(KafkaKey{SessionID: d.SessionID, EventType: d.EventType}) |
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.
optimization:
no need to send JSON as a key. it could be simply:
key := []byte(d.SessionID + d.EventType)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.
Hmm, currently we set the JSON schema for the key, so I guess this won't work. We could consider not having the schema and just using the concatenated string instead.
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.
nvm then. No need for pre-optimizations
Changes:
Fix https://linear.app/livepeer/issue/ENG-1702/send-raw-analytics-logs-to-kafka