Skip to main content

Overview

Lasso can optionally include routing metadata in RPC responses, allowing clients to inspect provider selection, retry behavior, and request timing. This is useful for debugging, monitoring, and understanding routing decisions. Metadata is opt-in only — responses do not include metadata by default.

Opt-In Mechanisms

Clients control metadata visibility via:

Query Parameter

Request Header

Values:
  • headers - Metadata in response headers
  • body - Metadata in response body
  • Omit parameter - No metadata (default)

Headers Mode

Request:
Response:

Decoding X-Lasso-Meta

The X-Lasso-Meta header contains base64url-encoded JSON:
Decoded metadata:

Size Limit

If encoded metadata exceeds max_meta_header_bytes (default 4KB), only X-Lasso-Request-ID is included. Configuration:
Fallback to body mode:

Body Mode

Request:
Response:
No size limit — body mode always includes full metadata.

Metadata Fields

Complete Schema

Field Descriptions

Use Cases

1. Debugging Provider Selection

Scenario: Understand why a specific provider was chosen.
Output:
Insight: Alchemy selected because it has lowest latency for eth_blockNumber.

2. Monitoring Retry Behavior

Scenario: Track failover attempts.
Example output:

3. Performance Analysis

Scenario: Identify slow requests and upstream latency.
Output:
Insight: 592ms spent waiting for provider, 3ms Lasso overhead.

4. Circuit Breaker Monitoring

Scenario: Detect when providers are degraded.

5. Client-Side Request Tracing

Scenario: Correlate client requests with server logs.
Server-side log lookup:

Client Library Examples

JavaScript/TypeScript

Python (web3.py)

Go (go-ethereum)

Performance Impact

Overhead Breakdown

Metadata only computed when requested — no overhead when include_meta is omitted.

Configuration

Observability Settings

Increase limit for complex metadata:

Troubleshooting

Metadata Not in Response

Symptom: Response does not include metadata despite include_meta parameter. Verify parameter:
Check ObservabilityPlug:

Large Metadata Missing from Headers

Symptom: X-Lasso-Request-ID present but X-Lasso-Meta absent. Cause: Metadata exceeds max_meta_header_bytes. Solution 1: Use body mode instead:
Solution 2: Increase header size limit:

Invalid Base64 Decoding

Symptom: JavaScript atob() fails with “Invalid character” error. Cause: Header uses base64url encoding (not standard base64). Fix: Replace - and _ before decoding:

Summary

Lasso’s request metadata provides:
  • Opt-in visibility into routing decisions and performance
  • Two delivery modes: headers (compact) or body (no size limit)
  • Comprehensive data: provider selection, retries, circuit state, timing
  • Client library support for JavaScript, Python, Go
  • Low overhead (<2ms for headers, <1ms for body)
  • Request tracing via UUID request IDs
  • Production-safe with configurable size limits