如何将跟踪和测量结果从 ECS 传输到 ElasticSearch?

发布于 2025-01-13 06:03:06 字数 6517 浏览 0 评论 0 原文

我想传输 AWS ECS 的跟踪和测量。我制作了一个脚本,使用 aws-otel-collector 收集跟踪和测量结果。

export const service = new awsx.ecs.FargateService("backend", {
    taskDefinitionArgs: { 
                          taskRole: role,  
                          containers: {  
                                         otelCollector: {   
                                                             image: image: "docker.io/amazon/aws-otel-collector",
                                                             essential: true,
                                                             logConfiguration: {
                                                                                   logDriver: "awslogs",
                                                                                   options: {
                                                                                               "awslogs-group": "/ecs/ecs-aws-otel-sidecar-collector",
                                                                                               "awslogs-region": region,
                                                                                               "awslogs-stream-prefix": "ecs",
                                                                                               "awslogs-create-group": "true"
                                                                                            }
                                                                               }
                                                          },
                                      
    
                                         logRuter: {          
                                         
                                           image: "docker.io/amazon/aws-for-fluent-bit:latest",
                                           essential: true,
                                           firelensConfiguration: {
                                                                    "type": "fluentbit",
                                                                    "options":{
                                                                                 "enable-ecs-log-metadata":"true"
                                                                               }
                                                                   },
                                           logConfiguration: {
                                                                logDriver: "awslogs",
                                                                options: {
                                                                            "awslogs-create-group": "true",
                                                                            "awslogs-group": "bakend-log",
                                                                            "awslogs-region": region,
                                                                            "awslogs-stream-prefix": "fluentbit"
                                                                         }
                                                              },
                                            memoryReservation: 50
                                            },

                                           backend: { 
                                                       image: 'steinko/helloworld-backend',
                                                       portMappings: [ backendLb ],
                                                       logConfiguration: {
                                                                            logDriver: "awsfirelens",
                                                                            options: { 
                                                                                         "Name":"es",
                                                                                         "match":"*",
                                                                                         "Port": "9200",
                                                                                         "Host":"efk-elastic",
                                                                                         "Logstash_format":"on",
                                                                                         "Replace_dots" :"on",
                                                                                         "Retry_limit":"false",
                                                                                         "Type":"doc",
                                                                                         "Suppress_Type_Name": "On",
                                                                                         "Cloud_ID": "My_deployment:xxxxxxxxxx",
                                                                                         "Cloud_Auth":"elastic:xxxxxxxxx",
                                                                                         "Index": "backend-index",
                                                                                         "tls": "On",
                                                                                         "tls.verify": "Off"
                                                                                         
                                                                                     }
                                                                        },
                                                       dependsOn: [
                                                                      {
                                                                           containerName: "otelCollector",
                                                                           condition: "START"
                                                                      }
                                                                 ]
                                                     }   
                                                
                                    },                
                                  
                        },
......

我发现可以使用 Dataprepper 传输 痕迹。如何将轨迹和测量结果传输到 eleaticsearch?

I want to transfer the traces and measurements for AWS ECS. I have made a script where I use aws-otel-collector collect traces and measurements.

export const service = new awsx.ecs.FargateService("backend", {
    taskDefinitionArgs: { 
                          taskRole: role,  
                          containers: {  
                                         otelCollector: {   
                                                             image: image: "docker.io/amazon/aws-otel-collector",
                                                             essential: true,
                                                             logConfiguration: {
                                                                                   logDriver: "awslogs",
                                                                                   options: {
                                                                                               "awslogs-group": "/ecs/ecs-aws-otel-sidecar-collector",
                                                                                               "awslogs-region": region,
                                                                                               "awslogs-stream-prefix": "ecs",
                                                                                               "awslogs-create-group": "true"
                                                                                            }
                                                                               }
                                                          },
                                      
    
                                         logRuter: {          
                                         
                                           image: "docker.io/amazon/aws-for-fluent-bit:latest",
                                           essential: true,
                                           firelensConfiguration: {
                                                                    "type": "fluentbit",
                                                                    "options":{
                                                                                 "enable-ecs-log-metadata":"true"
                                                                               }
                                                                   },
                                           logConfiguration: {
                                                                logDriver: "awslogs",
                                                                options: {
                                                                            "awslogs-create-group": "true",
                                                                            "awslogs-group": "bakend-log",
                                                                            "awslogs-region": region,
                                                                            "awslogs-stream-prefix": "fluentbit"
                                                                         }
                                                              },
                                            memoryReservation: 50
                                            },

                                           backend: { 
                                                       image: 'steinko/helloworld-backend',
                                                       portMappings: [ backendLb ],
                                                       logConfiguration: {
                                                                            logDriver: "awsfirelens",
                                                                            options: { 
                                                                                         "Name":"es",
                                                                                         "match":"*",
                                                                                         "Port": "9200",
                                                                                         "Host":"efk-elastic",
                                                                                         "Logstash_format":"on",
                                                                                         "Replace_dots" :"on",
                                                                                         "Retry_limit":"false",
                                                                                         "Type":"doc",
                                                                                         "Suppress_Type_Name": "On",
                                                                                         "Cloud_ID": "My_deployment:xxxxxxxxxx",
                                                                                         "Cloud_Auth":"elastic:xxxxxxxxx",
                                                                                         "Index": "backend-index",
                                                                                         "tls": "On",
                                                                                         "tls.verify": "Off"
                                                                                         
                                                                                     }
                                                                        },
                                                       dependsOn: [
                                                                      {
                                                                           containerName: "otelCollector",
                                                                           condition: "START"
                                                                      }
                                                                 ]
                                                     }   
                                                
                                    },                
                                  
                        },
......

I found out that one can use Dataprepper to transfer traces. How to transfer traces and measurements to eleaticsearch?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

捶死心动 2025-01-20 06:03:07

OTLP 导出器 https://www.elastic.co/guide/en/apm/get-started/current/open-telemetry-elastic.html" rel="nofollow noreferrer">aws-otel-collector 并将其指向您的 Elasticsearch APM 服务器。请参阅您的 ES APM 文档 如何做到这一点。

Configure OTLP exporter in your aws-otel-collector and point it to your Elasticsearch APM server. See your ES APM doc how to do that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文