0

I am trying to add xray tracing into all of my external calls and need some help. Http calls were pretty simple and well-documented, but I cannot find anything on smtp.

This is what I used to add xray tracing into an http call using the import "net/http".

// ... Created a client, then...
client = xray.Client(client)
result, err := client.Do(request.WithContext(context.Background()))

This is what I'm working with to add xray tracing into an smtp call using the import "net/smtp".

connection, err := smtp.Dial("smtp.server.com")
// ... Set sender and receiver, then...
writer, err := connection.Data()
_, _ = writer.Write("Message")
_ = writer.Close()
_ = connection.Quit()

I have tried digging into the smtp client and client writer structs but am unable to find to add the xray tracing.

Eldy
  • 173
  • 1
  • 5
  • 1
    To my understanding, AWS X-Ray is only for http calls, which are substantially different from SMTP sessions. HTTP, by itself, is a stateless protocol. Sessions are only emulated. SMTP sessions however do have states (new, authenticated, yada yada). – Markus W Mahlberg May 04 '20 at 23:14

1 Answers1

0

X-Ray currently does not support tracing of SMTP calls. As @Markus W Mahlberg mentioned, SMTP is quite different from HTTP. Tracing SMTP would need explicit handlers for different states within the X-Ray SDK.