Company
Date Published
Author
Anton Pirker
Word count
1411
Language
English
Hacker News points
None

Summary

Relay is an open source project by Sentry that receives data from Sentry SDKs for pre-processing before sending it to an upstream Relay server or ingesting and storing it in the Sentry infrastructure. To make Relay behave like an AWS Lambda Extension, it was implemented using the actor model in Rust, which allows it to process data extensively and scale with large distributed systems. The actor model is a fundamental unit of computation that has its own private internal state and can only perform three operations: creating another actor, sending a message, or deciding how to handle the next message received. Relay uses this model to implement the Sentry Lambda extension, which allows it to receive lifecycle events from Lambda functions and process data in real-time. The implementation involves defining an actor called AwsExtension that calls the register endpoint on startup, sends a NextEvent message to itself upon receiving a NextEvent message, and processes data received when an Invoke event is received. With this implementation, Relay can now be used as an AWS extension, allowing it to scale with large distributed systems and process data in real-time. The approach taken for implementing the Lambda Extension can also be applied to the sidecar approach, bringing features to other platforms that would not be possible without Relay.