aws / smithy-go

Smithy code generators for Go (in development)
Apache License 2.0
172 stars 51 forks source link

add tracing APIs and instrumentation #534

Closed lucix-aws closed 1 month ago

lucix-aws commented 1 month ago

Tracing component of #470

lucix-aws commented 1 month ago

General comment for the spans:

  1. Any reason why we picked the middlewares that we picked for when to start a child span? Retry makes a lot of sense, the other ones I suspect are the ones that we know can take longer but curious to hear your thoughts

Most of them are just the principal "phases" of the operation lifecycle, e.g. resolving endpoint, serializing. There's no real hard list of this anywhere, the closest thing we have to that might be the lifecycle breakdown in the (unpublished) client reference architecture.

The more niche ones were giving Initialize a span, and the outer BuildRequest (basically everything from serialize to build), I wanted to generally contain those since

  1. customizations go there
  2. I wanted the top level of root spans to roughly add up to the overall duration. Without the BuildRequest one, you'd basically have OperationSerializer in an oasis of un-spanned (well root spanned but yes) work.