What Is New in HAProxy 2.6
HAProxy 2.6 delivers a significant update focused on enhanced observability, security, and performance tuning. The release introduces native OpenTelemetry support, a new DNS resolution library, and powerful new stick table features for more dynamic traffic control.
| Category | Key Changes |
|---|---|
| New Features | OpenTelemetry support, Dynamic DNS resolution, Stick table data types (ipv6, string, binary) |
| Improvements | HTTP compression (br, deflate), Logging variables, Prometheus Exporter, FastCGI app scaling |
| Bug Fixes | Over 75 bugs resolved across various components |
How does OpenTelemetry integration improve monitoring?
HAProxy 2.6 now natively exports metrics to OpenTelemetry collectors, moving beyond its traditional Prometheus support. This provides a standardized way to push metrics into observability platforms like Jaeger without needing an external exporter sidecar.
You configure it by adding an opentelemetry section in your configuration. This lets you stream metrics directly, which simplifies the architecture for getting data into your tracing and monitoring systems.
What's new with DNS resolution?
The built-in DNS resolver has been completely replaced with a new asynchronous library. This change makes server discovery much more resilient to slow or failing DNS servers, preventing them from blocking the main HAProxy process.
In practice, this means your load balancer won't get stuck if a DNS query times out. The new resolver handles lookups in the background, which is crucial for dynamic environments like Kubernetes where backend IPs change frequently.
What can you do with new stick table types?
Stick tables now support IPv6 addresses, string, and binary data types, not just IPv4 and integers. This opens up new possibilities for tracking and routing decisions based on a wider range of criteria.
For example, you could use a string to track API keys or session tokens and apply rate limiting based on that value. The binary type allows you to store opaque data for advanced, custom tracking logic directly within HAProxy.
How is HTTP compression better?
Support for Brotli (br) and Deflate compression algorithms has been added. You can now specify different compression types for requests and responses, giving you finer control over performance and bandwidth usage.
This is configured using new options like compression algo and compression offload. The offload feature is particularly useful as it allows HAProxy to serve compressed static content from cache without reprocessing it each time.
What else was improved under the hood?
The Prometheus exporter gained new metrics, providing even deeper insight into HAProxy's internal state. Logging is now more flexible with additional fetch methods and converters, allowing for more detailed and customized log formats.
For FastCGI applications, the connection scaling has been improved. The release also includes a long list of bug fixes addressing issues in areas like HTTP, CLI, and the underlying memory management.
FAQ
Do I need to change my configuration to use the new DNS resolver?
No, the new asynchronous DNS resolver is a drop-in replacement. Your existing resolvers section will automatically benefit from the improved resilience without any config changes.
Can I use both OpenTelemetry and the built-in Prometheus exporter?
Yes, both can operate simultaneously. You can configure an opentelemetry section for OTLP output while still using the traditional stats endpoint for Prometheus scraping.
What's a practical use for string data in stick tables?
You can track and rate limit based on a user ID, API key, or any other string-based identifier from a request header or cookie, enabling more granular security policies than just IP address.
Is Brotli compression supported for both requests and responses?
Brotli support in HAProxy 2.6 is focused on response compression. The implementation handles accepting Brotli-encoded requests, but the primary compression features are for responses sent to clients.
Were any new sample fetches added for logging?
Yes, new sample fetches like fc_pp_authority and so_id were added, giving you more data points to extract from connections and requests for use in custom log formats.