Skip to content

Instantly share code, notes, and snippets.

@ncracker
Last active August 15, 2019 18:46
Show Gist options
  • Save ncracker/9346d50ea29c56dc0adbae4317d4e0fe to your computer and use it in GitHub Desktop.
Save ncracker/9346d50ea29c56dc0adbae4317d4e0fe to your computer and use it in GitHub Desktop.
# Basic configuration
global
log 127.0.0.1 local0
maxconn 4096
stats socket /tmp/haproxy
# Some sane defaults
defaults
log global
option dontlognull
retries 3
option redispatch
timeout client 5s
timeout server 5s
timeout connect 5s
# This declares a view into HAProxy statistics, on port 3833
# You do not need credentials to view this page and you can
# turn it off once you are done with setup.
listen stats
bind *:3833
mode http
stats enable
stats uri /
# This declares the endpoint for Datadogs public API
# as described here - https://docs.datadoghq.com/api/?lang=bash#post-timeseries-points
frontend metrics-api-forwarder
bind *:443
mode tcp
default_backend datadog-api
# This declares the endpoint where your Agents connects for
# sending metrics (e.g. the value of "dd_url").
frontend metrics-forwarder
bind *:3834
mode tcp
default_backend datadog-metrics
# This declares the endpoint where your Agents connects for
# sending traces (e.g. the value of "endpoint" in the APM
# configuration section).
frontend traces-forwarder
bind *:3835
mode tcp
default_backend datadog-traces
# This declares the endpoint where your agents connects for
# sending processes (e.g. the value of "url" in the process
# configuration section).
frontend processes-forwarder
bind *:3836
mode tcp
default_backend datadog-processes
# This declares the endpoint where your Agents connects for
# sending Logs (e.g the value of "logs.config.logs_dd_url")
frontend logs_frontend
bind *:10514
mode tcp
default_backend datadog-logs
# Datadog's public endpoints.
backend datadog-api
balance roundrobin
mode tcp
option tcplog
server mothership api.datadoghq.com:443 check port 80
# This is the Datadog server. In effect any TCP request coming
# to the forwarder frontends defined above are proxied to
backend datadog-metrics
balance roundrobin
mode tcp
option tcplog
server mothership haproxy-app.agent.datadoghq.com:443 check port 80
backend datadog-traces
balance roundrobin
mode tcp
option tcplog
server mothership trace.agent.datadoghq.com:443 check port 80
backend datadog-processes
balance roundrobin
mode tcp
option tcplog
server mothership process.datadoghq.com:443 check port 80
backend datadog-logs
balance roundrobin
mode tcp
option tcplog
server datadog efohch4w-intake.logs.datadoghq.com:10516 ssl verify required ca-file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment