Skip to content

Conversation

@leszko
Copy link
Contributor

@leszko leszko commented Mar 5, 2024

Changes:

  • Send analytics logs to Kafka (instead of Prometheus / Victoria Metrics)
  • Add more fields to Kafka Event

Fix https://linear.app/livepeer/issue/ENG-1702/send-raw-analytics-logs-to-kafka

@linear
Copy link

linear bot commented Mar 5, 2024

@leszko leszko requested review from thomshutt and victorges March 5, 2024 18:22
@leszko leszko marked this pull request as ready for review March 5, 2024 18:22
Copy link
Contributor

@victorges victorges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leszko leszko merged commit eeaf262 into main Mar 7, 2024
@leszko leszko deleted the rafal/analytics-kafka branch March 7, 2024 15:02
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})
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

@pwilczynskiclearcode pwilczynskiclearcode Mar 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants