Logging

request_id — ensures every request has a correlation ID

Category: Practical
Task: request_id — ensures every request has a correlation ID

Prerequisites: The product runtime and any backend services referenced by this configuration.

Run it: Use ghcr.io/praxis-proxy/praxis:0.7.2 and follow the first reverse-proxy tutorial to mount and start the configuration.

This configuration comes from the selected release. The example has not been run here; external services are not bundled.

Download the source file.

# Logging: Request IDs and Access Logs
#
# request_id — ensures every request has a correlation ID.
#   Forwards client-supplied IDs; generates one when absent. Echoed in
#   the response. The header_name field controls which header is used
#   (defaults to X-Request-ID).
#
# access_log — structured log line per request (method, path) and
#   response (status). Enable with RUST_LOG=info.
#
# Both placed before the router so they run on every request.
#
listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains: [main]

filter_chains:
  - name: main
    filters:
      - filter: request_id
        header_name: X-Trace-Id

      - filter: access_log

      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend

      - filter: load_balancer
        clusters:
          - name: backend
            endpoints:
              - "127.0.0.1:3000"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends