菜单
文档breadcrumb arrow Grafana Alloybreadcrumb arrow 参考breadcrumb arrow 组件breadcrumb arrow otelcolbreadcrumb arrow otelcol.processor.deltatocumulative
开源

实验性

otelcol.processor.deltatocumulative

实验性:这是一个实验性组件。实验性组件可能频繁发生破坏性变更,并且可能在没有等效替代品的情况下被移除。必须将 stability.level 标志设置为 experimental 才能使用此组件。

otelcol.processor.deltatocumulative 接受来自其他 otelcol 组件的指标,并将增量(delta)时效性的指标转换为累积(cumulative)时效性。

注意

otelcol.processor.deltatocumulative 是上游 OpenTelemetry Collector 的 deltatocumulative 处理器的一个包装。如果必要,bug 报告或功能请求将被重定向到上游仓库。

您可以通过赋予不同的标签来指定多个 otelcol.processor.deltatocumulative 组件。

用法

alloy
otelcol.processor.deltatocumulative "LABEL" {
  output {
    metrics = [...]
  }
}

参数

otelcol.processor.deltatocumulative 支持以下参数

名称类型描述默认值必需
max_staleduration在标记流为陈旧之前,等待新样本的时间。"5m"
max_streamsnumber要跟踪的流的上限。设置为 0 可禁用。9223372036854775807

otelcol.processor.deltatocumulative 跟踪传入的指标流。跟踪具有增量(delta)时效性的 Sum 和指数直方图指标,并将其转换为累积(cumulative)时效性。

如果自 max_stale 指定的持续时间以来没有收到新样本,则跟踪的流被认为是陈旧的并被丢弃。max_stale 必须设置为大于 "0s" 的持续时间。

max_streams 属性配置要跟踪的流的上限。如果达到跟踪流的限制,新的传入流将被丢弃。

otelcol.processor.deltatocumulative 的定义中支持以下块

层级描述必需
outputoutput配置接收到的遥测数据发送到哪里。
debug_metricsdebug_metrics配置此组件为监控其状态而生成的指标。

output 块

output 块配置一组组件以转发生成的遥测数据。

支持以下参数

名称类型描述默认值必需
logslist(otelcol.Consumer)要发送日志的消费者列表。[]
metricslist(otelcol.Consumer)要发送指标的消费者列表。[]
traceslist(otelcol.Consumer)要发送追踪的消费者列表。[]

您必须指定 output 块,但其所有参数都是可选的。默认情况下,遥测数据会被丢弃。相应地配置 metricslogstraces 参数,将遥测数据发送到其他组件。

debug_metrics 块

debug_metrics 块配置此组件为监控其状态而生成的指标。

支持以下参数

名称类型描述默认值必需
disable_high_cardinality_metricsboolean是否禁用某些高基数(high cardinality)指标。true

disable_high_cardinality_metrics 等同于 OpenTelemetry Collector 中 telemetry.disableHighCardinalityMetrics 功能门。它会移除可能导致高基数指标的属性。例如,关于 HTTP 和 gRPC 连接的指标中包含 IP 地址和端口号的属性会被移除。

注意

如果配置了 disable_high_cardinality_metrics,它仅适用于 otelcol.exporter.*otelcol.receiver.* 组件。

导出字段

导出以下字段,可供其他组件引用

名称类型描述
inputotelcol.Consumer其他组件可用于发送遥测数据的值。

input 接受用于指标的 otelcol.Consumer 数据。

组件健康状态

只有在配置无效时,otelcol.processor.deltatocumulative 才会被报告为不健康。

调试信息

otelcol.processor.deltatocumulative 不会暴露任何特定于组件的调试信息。

调试指标

  • otelcol_deltatocumulative_streams_tracked (gauge): 当前聚合状态跟踪的流数量。
  • otelcol_deltatocumulative_streams_limit (gauge): 跟踪流的上限。
  • otelcol_deltatocumulative_streams_max_stale_seconds (gauge): 没有新样本后流被丢弃的持续时间。
  • otelcol_deltatocumulative_datapoints (counter): 已处理的数据点总数(成功或失败)。

示例

基本用法

此示例将增量(delta)时效性的指标转换为累积(cumulative)指标,然后将其发送到 otelcol.exporter.otlp 进行进一步处理

alloy
otelcol.processor.deltatocumulative "default" {
  output {
    metrics = [otelcol.exporter.otlp.production.input]
  }
}

otelcol.exporter.otlp "production" {
  client {
    endpoint = sys.env("OTLP_SERVER_ENDPOINT")
  }
}

导出 Prometheus 数据

此示例将增量(delta)时效性的指标转换为累积(cumulative)指标,然后将其转换为需要累积(cumulative)时效性的 Prometheus 数据

alloy
otelcol.processor.deltatocumulative "default" {
  output {
    metrics = [otelcol.exporter.prometheus.default.input]
  }
}

otelcol.exporter.prometheus "default" {
  forward_to = [prometheus.remote_write.default.receiver]
}

prometheus.remote_write "default" {
  endpoint {
    url = sys.env("PROMETHEUS_SERVER_URL")
  }
}

兼容组件

otelcol.processor.deltatocumulative 可以接受来自以下组件的参数

otelcol.processor.deltatocumulative 具有可被以下组件消费的导出项

注意

连接某些组件可能不合理,或者组件可能需要进一步配置才能使连接正常工作。有关更多详细信息,请参阅链接的文档。