3 unstable releases

0.3.0 Dec 17, 2024
0.1.1 Dec 6, 2024
0.1.0 Nov 21, 2024

#1743 in Procedural macros


Used in lambda-lw-http-router

MIT license

9KB
96 lines

Procedural macros for the lambda-lw-http-router crate.

Note: This is a proc-macro implementation crate for lambda-lw-http-router and is not meant to be used directly. Please use the main crate instead.

The macros in this crate are re-exported by the main crate, and using them directly may lead to version conflicts or other issues. Additionally, this crate's API is not guaranteed to be stable between minor versions.

Usage

Instead of using this crate directly, use the main crate:

[dependencies]
lambda-lw-http-router = "0.1"

See the lambda-lw-http-router documentation for more information on how to use the router.


Serverless OTLP Forwarder

License: MIT OpenTelemetry AWS Lambda Rust Python Node.js Stability: Experimental

diagram

The Serverless OTLP Forwarder enables serverless applications to send OpenTelemetry data to collectors without the overhead of direct connections or sidecars.

Key Features

  • 🚀 Minimal Performance Impact: Optimized for Lambda execution and cold start times
  • 🔒 Secure by Design: Uses CloudWatch Logs for data transport, no direct collector exposure
  • 💰 Cost Optimization: Supports compression and efficient protocols
  • 🔄 Language Support: Native implementations for Rust, Python, and Node.js
  • 📊 AWS Application Signals: Experimental integration support

Documentation

Visit the documentation site for:

Quick Start

  1. Install prerequisites:

    # Install AWS SAM CLI
    brew install aws-sam-cli  # or your preferred package manager
    
    # Install rust and cargo lambda
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    cargo install cargo-lambda
    
  2. Configure the default collector:

    # Create a configuration in AWS Secrets Manager
    aws secretsmanager create-secret \
       --name "serverless-otlp-forwarder/keys/default" \
       --secret-string '{
         "name": "my-collector",
         "endpoint": "https://collector.example.com",
         "auth": "x-api-key=your-api-key"
       }'
    
  3. Deploy the forwarder:

    # Clone the repository
    git clone https://github.com/dev7a/serverless-otlp-forwarder && cd serverless-otlp-forwarder
    # Deploy
    sam build --parallel && sam deploy --guided
    
  4. Instrument your application using our language-specific libraries:

Background

This project addresses specific challenges in serverless observability, particularly the performance impact of traditional OpenTelemetry collection methods. The standard approach using OTEL/ADOT Lambda Layer extensions introduces significant overhead through sidecar agents, affecting both cold start times and runtime performance.

This becomes especially relevant in scenarios requiring memory-optimized Lambda functions, where the resource overhead of traditional collectors can offset the benefits of memory optimization. The forwarder approach provides an alternative that maintains telemetry capabilities while minimizing resource utilization.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~0.5–1MB
~21K SLoC