You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhance Typed Headers to Handle Custom Header Definitions #41
The current typed header system in Relic primarily supports common built-in headers and lacks a flexible mechanism for handling custom headers. This limits developers who need strong typing and validation for domain-specific or proprietary headers.
Proposal
Enhance the typed header implementation to fully support custom headers by:
Allowing developers to define their own typed header classes (e.g., X-Custom-User-ID)
Registering custom headers for parsing and serialization, similar to built-in headers
Supporting integration with request/response objects via a unified API
Validating header values based on user-defined types or rules
Use Case
A developer is building a microservice architecture that relies on custom headers for things like tracing (X-Trace-ID), auth tokens (X-App-Token), or tenant identification (X-Tenant-ID). They want these headers to be handled with type safety, proper parsing, and integrated developer tooling (autocomplete, validation, etc).
Alternatives
N/A
Additional context
This change would improve Relic’s ergonomics and extensibility, and bring the typed header API closer to the flexibility of frameworks like Express.js, but with type safety baked in. It also complements the goal of developer-friendliness, especially in large or multi-team projects.
Activity