Skip to content

OpenTelemetry Collectorで必要な属性だけを残して集約する

metricstransformprocessorがあるので、これを使って集約ができるが、metricstransform はバッチ単位での集約となるので、複数のノードから送られたメトリクスを合算するような挙動はできない。

[! Info] This processor only supports renames/aggregations within a batch of metrics. It does not do any aggregation across batches, so it is not suitable for aggregating metrics from multiple sources (e.g. multiple nodes or clients).

processors:
metricstransform:
transform:
- include: added_metrics_count
action: update
operations:
- action: aggregate_labels
label_set:
- service.namespace
- service.name
- process.runtime.name
- process.runtime.version
- metricpoint_epoch_step
aggregation_type: sum
service:
pipelines:
metrics:
processors: [metricstransform]

集約するアクションとして aggregate_labels の他にも aggregate_label_values がある。前者は同じラベルのデータポイントを集約する。後者は分からないけど、たぶんラベルの値も集約するアクションなのではないか。