搜索按注释过滤的AWS X射线

时间:2020-04-20 15:01:04

标签: amazon-web-services aws-lambda aws-xray

我已经为我的AWS Lambda函数启用了X射线跟踪,并从我的代码库和捕获accountId的注释中启用了X射线跟踪。用于从X射线获取数据的AWX X射线doc提到索引与X射线轨迹相关的注释

我正在使用accountId注释跟踪。我希望检索所有具有accountId = '12345'

的迹线

我已确认我的踪迹具有所需的注释。我找到了这个doc,但是我不确定如何从cli应用这些过滤器。

使用aws xray get-trace-summaries --start-time <start_time> --end-time <end_time>

的跟踪结果的摘录
"Annotations": {
                "lambdaAccountId": [
                    {
                        "AnnotationValue": {
                            "StringValue": "12345"
                        }
                    }
                ]
            }, 

1 个答案:

答案 0 :(得分:2)

aws xray get-trace-summaries --start-time=1587398166 --end-time=1587398566 --filter-expression "annotation.lambdaAccountId=\"12345\""

会做的工作。这是一些sample queries

的链接