使用 Amazon OpenSearch Ingestion 从跟踪中派生指标 - 亚马逊 OpenSearch 服务
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用 Amazon OpenSearch Ingestion 从跟踪中派生指标

您可以使用 Amazon OpenSearch Ingestion 从 OpenTelemetry 跟踪中派生指标。以下示例管道接收传入跟踪,提取在 30 秒滚动窗口中聚合的名为 durationInNanos 的指标。然后,从传入跟踪中派生直方图。

管道包含以下子管道:

  • entry-pipeline – 从 OpenTelemetry Collector 接收跟踪数据并将其转发给 trace_to_metrics_pipeline 子管道。

  • trace-to-metrics-pipeline – 从 entry-pipeline 子管道接收跟踪数据,汇总数据,然后根据 serviceName 字段的值从跟踪中派生 durationInNanos 直方图。然后,将派生的指标发送给名为 metrics_for_traces 的 OpenSearch 索引。

version: "2" entry-pipeline: source: otel_trace_source: # Provide the path for ingestion. ${pipelineName} will be replaced with sub-pipeline name. # In this case it would be "/entry-pipeline/v1/traces". This will be endpoint URI path in OpenTelemetry Exporter configuration. path: "/${pipelineName}/v1/traces" sink: - pipeline: name: "trace-to-metrics-pipeline" trace-to-metrics-pipeline: source: pipeline: name: "entry-pipeline" processor: - aggregate: # Pick the required identification keys identification_keys: ["serviceName"] action: histogram: # Pick the appropriate values for each of the following fields key: "durationInNanos" record_minmax: true units: "seconds" buckets: [0, 10000000, 50000000, 100000000] # Specify an aggregation period group_duration: "30s" sink: - opensearch: ... index: "metrics_for_traces"

有关另一个示例管道,请参阅跟踪到指标异常管道蓝图。有关蓝图的更多信息,请参阅 使用蓝图创建管道