matanolabs / matano

Open source security data lake for threat hunting, detection & response, and cybersecurity analytics at petabyte scale on AWS
https://matano.dev
Apache License 2.0
1.46k stars 100 forks source link

Structured log output for all functions #58

Open timoguin opened 1 year ago

timoguin commented 1 year ago

All functions should output fully structured logs.

Considerations

Every individual event that triggers a Lambda should result in at least one line of structured output. This will improve observability in a number of ways. By default they're going to go to CloudWatch Logs, which allows us to create alarms based on metrics calculated from the logs. Then they could also be easily streamed from there into Kinesis Firehose, and then delivered in parquet right back into Matano.

A good structured logging library will allow us to create a log context that we can flow through the application logic, attaching relevant log data along the way, and then flushing one line at the end. High cardinality log output is key.

Tasks

References

Will add later.