In search of traceId placeholder

1. The problem I’m having:

Caddy by default logs traceId, i love it :slight_smile: But, is there way to add traceId to headers too?


    handle / {

        root * /usr/share/caddy
        try_files {path} /index.html
        header traceid {traceID}


2. Error messages and/or full log output:

No errors, just cant find how to pass traceId placeholder (is it exists?) to headers

3. Caddy version:


4. How I installed and ran Caddy:

docker latest with mounted Caddyfile (above)

Solution that i just found closely is what i expect

header trace_id {header.traceparent}

Header that contains traceID:


Hope would be helpful not only for me :slight_smile:

FYI this only handles requests to exactly /. Are you sure that’s what you wanted?

Headers with underscores aren’t spec compliant. You should probably be doing Trace-Id instead.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.