amazon-web-services - 如何在Golang中将AWS Xray跟踪添加到SMTP调用中

标签 amazon-web-services go smtp aws-xray

我正在尝试将xray跟踪添加到我的所有外部 call 中,并且需要一些帮助。 Http调用非常简单并且有据可查,但是我无法在smtp上找到任何内容。

这就是我使用导入“net / http”将xray跟踪添加到http调用中的方法。

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

这就是我正在使用导入“net / smtp”将x射线跟踪添加到smtp调用中的方法。
connection, err := smtp.Dial("smtp.server.com")
// ... Set sender and receiver, then...
writer, err := connection.Data()
_, _ = writer.Write("Message")
_ = writer.Close()
_ = connection.Quit()

我已经尝试研究smtp客户端和客户端编写器结构,但是找不到添加X射线跟踪。

最佳答案

X-Ray当前不支持SMTP call 跟踪。正如@Markus W Mahlberg提到的,SMTP与HTTP完全不同。跟踪SMTP将需要X-Ray SDK中不同状态的显式处理程序。

关于amazon-web-services - 如何在Golang中将AWS Xray跟踪添加到SMTP调用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61598143/

相关文章:

c# - 发送电子邮件的 SMTP 错误?

php - 无法在 codeigniter 3 中使用 SMTP gmail 配置发送电子邮件

amazon-web-services - Terraform AWS Cognito 应用程序客户端

amazon-web-services - 如何在 Spark MLLib 中为支持向量机配置内核选择和损失函数

go - 声明指向结构的全局指针

html - 在 Go 中从 html 页面中提取文本

oauth-2.0 - 通过 XOAUTH2 的 Office 365 SMTP 身份验证

amazon-web-services - 如何在 Ansible 中定义具有一系列端口的监听器的 AWS ELB

amazon-web-services - 如何使用公共(public)IP获取Windows Server的SSL证书?

arrays - Go 中 []Foo(nil) 和 []Foo{} 的区别