Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Last active August 21, 2024 18:30
How to identify requests as part of an end-to-end tracing strategy
unique-id-format "%[uuid]"
unique-id-header X-Correlation-ID
http-after-response set-header X-Correlation-ID %[unique-id]
log-format "$HAPROXY_HTTP_LOG_FMT %[unique-id]"
sudo apt-get install hapee-2.9r1-lb-fingerprint-ssl
global
module-path /opt/hapee-2.9/modules
module-load hapee-lb-fingerprint-ssl.so
frontend mysite
http-request set-var(txn.client_fingerprint) req.fingerprint_ssl.ja3_hash(EL_EXCLUDE:41,EL_SORT)
log-format "$HAPROXY_HTTP_LOG_FMT %[var(txn.client_fingerprint)]"
log-format-sd "%{+Q,+E}o[request@58750 host=%[var(txn.host)] referer=%[var(txn.referer)] user_agent=%[var(txn.user_agent)]][custom@58750 client_fingerprint=%[var(txn.client_fingerprint)]]"
log-format "$HAPROXY_HTTP_LOG_FMT %[unique-id] %[var(txn.client_fingerprint)]"
log-format-sd "%{+Q,+E}o[request@58750 host=%[var(txn.host)] referer=%[var(txn.referer)] user_agent=%[var(txn.user_agent)]][custom@58750 correlation_id=%[unique-id] client_fingerprint=%[var(txn.client_fingerprint)]]"
unique-id-format "%[uuid]"
unique-id-header X-Correlation-ID
http-after-response set-header X-Correlation-ID %[unique-id]
log-format-sd "%{+Q,+E}o[request@58750 host=%[var(txn.host)] referer=%[var(txn.referer)] user_agent=%[var(txn.user_agent)]][custom@58750 correlation_id=%[unique-id] client_fingerprint=%[var(txn.client_fingerprint)]]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment