- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用2个容器,应用程序和X射线作为辅助工具来启动ECS任务。在撰写了几篇博客文章和示例之后,我仍然面临这样的错误:在Xray AWS控制台中看不到任何XRAY段。
显然错误是,应用程序无法连接到X射线侧车以发送X射线段。
应用容器日志中的行显示了以下内容:
[错误]写udp 127.0.0.1:35963->127.0.0.1:2000:写入:连接被拒绝
整体ECS服务/任务设置:
2020-06-06 14:36:36rate: 0.050000
2020-06-06 14:36:361591446996579912116 [Trace] SamplingStrategy decided: true
2020-06-06 14:36:361591446996579934272 [Trace] Closing segment named jukebox-front
2020-06-06 14:36:361591446996579987354 [Error] write udp 127.0.0.1:35963->127.0.0.1:2000: write: connection refused
2020-06-06 14:36:362020/06/06 12:36:36 ping requested, reponding with HTTP 200
2020-06-06 14:36:362020/06/06 12:36:36 ping requested, reponding with HTTP 200
2020-06-06 14:36:361591446996564675990 [Trace] Beginning segment named jukebox-front
2020-06-06 14:36:361591446996564705526 [Trace] Determining ShouldTrace decision for:
2020-06-06 13:27:212020-06-06T11:27:21Z [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.eu-central-1.amazonaws.com
2020-06-06 13:27:212020-06-06T11:27:21Z [Info] Starting proxy http server on 0.0.0.0:2000
2020-06-06 13:27:012020-06-06T11:27:01Z [Info] Using region: eu-central-1
2020-06-06 13:26:412020-06-06T11:26:41Z [Info] Using buffer memory limit of 19 MB
2020-06-06 13:26:412020-06-06T11:26:41Z [Info] 304 segment buffers allocated
2020-06-06 13:26:412020-06-06T11:26:41Z [Info] Initializing AWS X-Ray daemon 3.2.0
{
"executionRoleArn": "arn:aws:iam::xxxxxxxx:role/ecsTaskExecutionRole",
"taskRoleArn": "arn:aws:iam::xxxxxxxx:role/ecsTaskRole",
"containerDefinitions": [
{
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/ecs/td-jukebox",
"awslogs-region": "eu-central-1",
"awslogs-stream-prefix": "ecs"
}
},
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 9000
}
],
"environment": [
{
"name": "AWS_XRAY_DAEMON_ADDRESS",
"value": "0.0.0.0:2000"
},
{
"name": "PORT",
"value": "9000"
}
],
"memoryReservation": 128,
"image": "<<app-image>>:latest",
"essential": true,
"links": [
"xray-daemon"
],
"name": "jukebox"
},
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/ecs/td-jukebox",
"awslogs-region": "eu-central-1",
"awslogs-stream-prefix": "ecs"
}
},
"portMappings": [
{
"hostPort": 0,
"protocol": "udp",
"containerPort": 2000
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 2000
}
],
"command": [
"\"-t\"",
"\"0.0.0.0:2000\""
],
"cpu": 32,
"memoryReservation": 256,
"image": "amazon/aws-xray-daemon",
"essential": true,
"name": "xray-daemon"
}
],
"compatibilities": [
"EC2"
],
"family": "td-jukebox",
"requiresCompatibilities": [
"EC2"
],
"networkMode": "bridge"
}
-l,dev,-f,/var/log/xray.log,-o,-n,eu-central-1
tail -f /var/log/xray.log
2020-06-06T16:33:07Z [Debug] ARN of the AWS resource running the daemon:
2020-06-06T16:33:07Z [Debug] No Metadata set for telemetry records
2020-06-06T16:33:07Z [Debug] Using Endpoint: https://xray.eu-central-1.amazonaws.com
2020-06-06T16:33:07Z [Debug] Telemetry initiated
2020-06-06T16:33:07Z [Info] HTTP Proxy server using X-Ray Endpoint : https://xray.eu-central-1.amazonaws.com
2020-06-06T16:33:07Z [Debug] Using Endpoint: https://xray.eu-central-1.amazonaws.com
2020-06-06T16:33:07Z [Debug] Batch size: 50
2020-06-06T16:33:07Z [Info] Starting proxy http server on 0.0.0.0:2000
2020-06-06T16:34:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:35:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:36:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:37:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:38:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:39:07Z [Debug] Skipped telemetry data as no segments found
2020-06-06T16:40:07Z [Debug] Skipped telemetry data as no segments found
env | grep XRAY
XRAY_DAEMON_PORT_2000_UDP_PROTO=udp
XRAY_DAEMON_PORT_2000_TCP=tcp://172.17.0.7:2000
XRAY_DAEMON_PORT_2000_UDP_ADDR=172.17.0.7
XRAY_DAEMON_ENV_AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=/v2/credentials/0e9e6ca8-c6d1-4f72-975e-aa3d99fdb64e
XRAY_DAEMON_ENV_ECS_CONTAINER_METADATA_URI_V4=http://169.254.170.2/v4/8a6cd6e9-bda7-4579-8415-471a435d14b4
XRAY_DAEMON_PORT_2000_UDP_PORT=2000
AWS_XRAY_DAEMON_ADDRESS=xray-daemon:2000
XRAY_DAEMON_ENV_ECS_CONTAINER_METADATA_URI=http://169.254.170.2/v3/8a6cd6e9-bda7-4579-8415-471a435d14b4
XRAY_DAEMON_PORT_2000_TCP_ADDR=172.17.0.7
XRAY_DAEMON_PORT_2000_UDP=udp://172.17.0.7:2000
XRAY_DAEMON_PORT_2000_TCP_PORT=2000
XRAY_DAEMON_PORT=tcp://172.17.0.7:2000
XRAY_DAEMON_ENV_AWS_EXECUTION_ENV=AWS_ECS_EC2
XRAY_DAEMON_NAME=/ecs-td-jukebox-13-jukebox-d0ddb483ebf899aee801/xray-daemon
XRAY_DAEMON_PORT_2000_TCP_PROTO=tcp
echo
命令,以通过执行以下操作通过UDP 2000将数据发送到xray守护程序
echo "test data" > /dev/udp/172.17.0.7/2000
...而且工作正常...至少发送成功,但X射线段的格式当然是错误的。
2020-06-06T18:53:45Z [Warn] Missing header or segment: test data
2020-06-06T18:54:07Z [Debug] Send 1 telemetry record(s)
2020-06-06T18:55:07Z [Debug] Send 1 telemetry record(s)
Send 1 telemetry record
,但在AWSXray控制台中什么也没出现...仍然没有数据。等待了几分钟之后,出现在xray守护程序日志文件中:
2020-06-06T19:03:07Z [Debug] Failed to send telemetry 1 record(s). Re-queue records. SerializationError: failed to unmarshal response error
status code: 400, request id:
caused by: UnmarshalError: failed decoding error message
00000000 3c 68 74 6d 6c 3e 0d 0a 3c 68 65 61 64 3e 3c 74 |<html>..<head><t|
00000010 69 74 6c 65 3e 34 30 30 20 42 61 64 20 52 65 71 |itle>400 Bad Req|
00000020 75 65 73 74 3c 2f 74 69 74 6c 65 3e 3c 2f 68 65 |uest</title></he|
00000030 61 64 3e 0d 0a 3c 62 6f 64 79 20 62 67 63 6f 6c |ad>..<body bgcol|
00000040 6f 72 3d 22 77 68 69 74 65 22 3e 0d 0a 3c 63 65 |or="white">..<ce|
00000050 6e 74 65 72 3e 3c 68 31 3e 34 30 30 20 42 61 64 |nter><h1>400 Bad|
00000060 20 52 65 71 75 65 73 74 3c 2f 68 31 3e 3c 2f 63 | Request</h1></c|
00000070 65 6e 74 65 72 3e 0d 0a 3c 2f 62 6f 64 79 3e 0d |enter>..</body>.|
00000080 0a 3c 2f 68 74 6d 6c 3e 0d 0a |.</html>..|
caused by: invalid character '<' looking for beginning of value
2020-06-06T19:04:07Z [Debug] Send 2 telemetry record(s)
2020-06-06T19:05:07Z [Debug] Send 1 telemetry record(s)
2020-06-06T19:06:07Z [Debug] Send 1 telemetry record(s)
2020-06-06T19:07:07Z [Debug] Send 1 telemetry record(s)
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"github.com/aws/aws-xray-sdk-go/xray"
"github.com/pkg/errors"
)
...
func getXRAYAppName() string {
appName := os.Getenv("XRAY_APP_NAME")
if appName != "" {
return appName
}
return "front"
}
type pingHandler struct{}
func (h *pingHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
log.Println("ping requested, responding with HTTP 200")
writer.WriteHeader(http.StatusOK)
}
func main() {
xraySegmentNamer := xray.NewFixedSegmentNamer(getXRAYAppName())
http.Handle("/ping", xray.Handler(xraySegmentNamer, &pingHandler{}))
log.Fatal(http.ListenAndServe(":"+getServerPort(), nil))
}
最佳答案
您可以尝试更改:
"environment": [
{
"name": "AWS_XRAY_DAEMON_ADDRESS",
"value": "0.0.0.0:2000"
},
"environment": [
{
"name": "AWS_XRAY_DAEMON_ADDRESS",
"value": "xray-daemon:2000"
},
关于amazon-web-services - AWS ECS Xray边车 “write: connection refused”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62232386/
我有一个使用最新稳定的 aws_xray_sdk 用 Python 3.6 编写的 AWS Lambda,并部署为 lambda 函数,而不是 API 网关端点。 一切都按预期运行,但是,我为 lam
我可以将 jira 包与 python 一起使用,并从 JIRA 更新或获取问题详细信息。但我想知道如何使用 python 中的 post 请求将测试执行结果导入到 XRAY JIRA 中。我已经使用
我在使用 aws xras.sql 进行 mysql 查询时遇到错误。我从下面的链接中获取实现文档 https://docs.aws.amazon.com/xray/latest/devguide/x
我正在尝试为我们的 AWS ECS Spring 启动应用程序实现 XRAY。为此,我按照 AWS documentation 的建议为 docker 守护进程创建了一个带有单独 docker 文件的
我正在试验 xray 库(Python 中的 N-D 标记数组和数据集)。我正在使用转置来更改索引顺序,但结果没有任何变化。 以下代码段访问 NetCDF 文件并分配给 xray 数据集,提取数据子集
我已经开始使用 AWSXRay 来更深入地了解为什么我的 lambda 函数性能不理想。这个 lambda 函数运行一个 gql 服务,这意味着它有很多对其他 lambda 函数以及用于缓存的 dyn
我们如何根据http状态代码对aws xray中的数据进行采样,例如,我会对状态代码为200的40%的记录和状态代码为500的100%的记录进行采样。下面是示例json,但我无法对数据进行采样 con
AWS XRay 是一项跟踪服务,可让您跟踪分布式系统中的请求,甚至分析您的服务。无需过多了解 XRay 的工作原理,它基本上会监视您的服务,并通过 UDP 将有关每个服务请求的数据发送到守护程序,该
要创建子分段 aws-xray 需要打开有效分段。默认情况下,远程 lambda 执行会为您打开一个段,您只需添加一个子段,但在本地运行时,我们需要在添加子段之前手动打开段。 我可以将东西放在 try
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我遇到过需要显示网页特定图像的 xray 的场景。 所以我使用的是 css 属性 filter: xray; , 它与 IE8 完美配合。但是对于像 Chrome、Firefox 甚至 IE11/Ed
我尝试通过以下方式为所有 lambda 函数启用 aws-xray: 无服务器.yml provider: tracing: lambda: true apiGateway: tr
我可以在本地以无服务器方式离线执行 lambda,我已在 .env 文件中将 AWS_DAEMON_ADRESS 设置为“127.0.0.1:2000”,但监听此端口的运行守护程序不会从执行中接收任何
我正在使用 AWS lambda 和 eventbridge。一个 lambdaA 向 eventbridge 发送事件另一个 lambdaB 接收此事件并将其保存到数据库中。我想要做的是在这个流上添
我正在尝试使用 Cucumber 和 Java 设置一个自动化框架。我使用 Itellij IDEA 作为我的 IDE。到目前为止,我能够自动化测试用例。我阅读了 Xray 文档并意识到我应该使用 R
我正在尝试在新的 Spring Boot 应用程序中设置 AWS XRay。 我想在投入生产之前在本地进行测试。该应用程序在本地与 dynamoDB 客户端和 STS 一起运行,以承担调用 dynam
我发现只需选中一个复选框(或设置 Tracing: Active 如果使用 SAM),我就可以在我的 lambda 函数上启用 X 射线跟踪。 这增加了高级日志记录。 如果我想要更详细的日志记录,我的
到底应该如何使用 Sails 安装 AWS XRAY? 我正在尝试翻译 installation instructions Sails 使用 Express 中间件的首选方式,但我却一败涂地。 大多数
我们最近开始将 AWS Xray 添加到我们的 Spring 项目中,并成功利用 AWSXRayServletFilter 创建 Segments 来满足我们的客户请求。 现在我们还开始添加 AWS
我正在尝试检测用 Go 编写的 Web 服务器,该服务器提供 REST API,在 AWS ECS 上的容器中运行。我现在正在 VSCode 中的 Debug 中运行服务器,致力于概念证明,该证明将显
我是一名优秀的程序员,十分优秀!