News for hackers. Stuff that matters.
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by guidoism on Wednesday May 26, 2021 @11:18PM (#27298990)
Request ID! I added that to the Amazon web servers about 20 years ago! My code probably doesn’t exist anymore but it’s funny to see it referenced on HN this many years later.
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by an_account_name on Wednesday May 26, 2021 @11:29PM (#27299062)
If it’s in APLCore it’s still running somewhere, you can be sure
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by guidoism on Thursday May 27, 2021 @12:41PM (#27305068)
Oh man, I gotta lot of code in APLCore. I can't believe that's still around too. Wow.
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by booleanbetrayal on Wednesday May 26, 2021 @04:30PM (#27295702)
I recently implemented support for this in the prometheus-exporter gem.

https://github.com/discourse/prometheus_exporter/pull/150

What's annoying about the encoded time value is version 1 (the only version still) is in seconds precision. Makes the value non-viable for any sort of queue time metric. Better than nothing, but would have been nice if it were micro.

Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by Spivak on Wednesday May 26, 2021 @04:11PM (#27295471)
I think this the AWS docs explain this fairly well.

https://docs.aws.amazon.com/elasticloadbalancing/latest/appl...

The format for the field is

     X-Amzn-Trace-Id: Field=version-time-id
and you're allowed to add custom fields that don't follow this format and they will be preserved.
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by wdb on Wednesday May 26, 2021 @06:01PM (#27296656)
Have a look at this propagator from Opentelemetry: https://github.com/open-telemetry/opentelemetry-go-contrib/b...

If you extract this trace id and use it as your request id you can follow it from the load balancer all the way to the end.

Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by kortex on Wednesday May 26, 2021 @10:56PM (#27298826)
I wonder if the system propagates "baggage" headers. OpenTelemetry uses this header to propagate span/trace IDs.

https://www.w3.org/TR/baggage/

Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by uhhhhhhhhhhhhhh on Wednesday May 26, 2021 @11:56PM (#27299227)
Wasnt there an rfc recommending against the use of X- prefix headers? I guess that didnt hold
Re:Using the “X-AMZN-Trace-Id” Header for Request Tracing Th... by OJFord on Thursday May 27, 2021 @04:15AM (#27300552)
Yes, 'deprecated' in RFC6648 (2012): https://datatracker.ietf.org/doc/html/rfc6648

`X-AMZN-something` at least though probably predates that; a mix of `X-AMZN` and `AMZN` would be annoying. (Although I suppose they could say 'We've deprecated `X-`, it'll be stripped and still work, but please don't use it in new code' applying to all of them, old and new.)