X-Ray tracing for Kotlin Ktor client

Thursday, 09 March 2023, 13:04

Just yesterday I wrote about X-Ray integration for Rust SDK. Tracing is very important in serverless microservice architecture - if you have tens or hundreds of AWS Lambda functions behind API Gateway communicating via SQS queues looking into logs in single place will not be enough - with the main issue very often being lack of that place to look for in the first place. When working with Kotlin and distributed microservices, usually default choice is Ktor (for client). It's possible to track external communication (non-AWS services) with X-Ray, but of course it needs to be recorded. I've build an extension (called feature in Ktor) that saves each external HTTP call as X-Ray trace.

Tags: , ,

» Komentarze

X-Ray tracing for AWS Rust SDK in Lambda runtime

Thursday, 09 March 2023, 01:20

Rust becomes more and more widely used in many places and AWS cloud is no exception. With AWS SDK for Rust (currently in preview) and Rust runtime for Lambda it's possible to build regular Lambda functions. Rust gives those serverless components safety and runtime speed but it's still quite new and ecosystem around Rust for AWS Lambda does not cover all features from other SDKs. One of such missing features is good X-Ray integration. There is no fully-flagged instrumentation for Rust SDK and if you search for solutions how to include such tracing in Rust projects using SDK… you will find planty of different solutions and there is high chance that none of them is what you are looking for.

Tags: , , ,

» Komentarze

Monitoring Lambda memory usage - X-Ray aware version

Tuesday, 30 July 2019, 07:17

In serverless architecture on AWS Lambda is a basic computing service. AWS provides some basic metrics related to it, like execution time, invocations count etc. but one important metric is missing - memory consumption. Knowing how much memory your functions use allows you to optimize resources and reduce costs (or increase to avoid failures). It can be very simply generated out of logs (since Lambda logs execution report after each invocation) with CloudWatch metric filter feature. And this approach has been described plenty of times around the web, including ready solutions. So I will not elaborate that much on the concept, as has already been done. But there is one trick - if you use X-Ray this solutions will not work. At least - not out of the box.

Tags: , , , , , ,

» Komentarze