Docs » Splunk Distribution of the OpenTelemetry Collector の利用開始 » Collector コンポーネント » Collectorコンポーネント: プロセッサー » Metrics generation processor

Metrics generation processor 🔗

The Splunk Distribution of the OpenTelemetry Collector uses the Metrics Generation processor to create new metrics using existing metrics following a given rule.

This processor currently supports the following two rule types for creating a new metric:

  • calculate. Creates a new metric from two existing metrics by applying one of the following arithmetic operations: add, subtract, multiply, divide, or percent.

    • For example, use it to calculate the pod.memory.utilization metric with the equation pod.memory.utilization = (pod.memory.usage.bytes / node.memory.limit.

    • Learn more at Using the calculate rule.

  • scale. Creates a new metric by scaling the value of an existing metric with a given constant number.

    • For example, use it to convert pod.memory.usage metric values from Megabytes to Bytes by multiplying the existing metric’s value by 1,048,576.

はじめに 🔗

以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:

  1. Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:

  1. Configure the metricsgeneration processor as described in the next section.

  2. Collector を再起動します。

サンプル構成 🔗

To activate the resource processor, add metricsgeneration to the processors section of your configuration file. Specify the configuration using a list of generation rules. Generation rules find the metrics which match the given metric names and apply the specified operation to those metrics. For example:

processors:
  metricsgeneration:
      # specify the metric generation rules
      rules:
            # Name of the new metric. This is a required field.
          - name: <new_metric_name>

            # Unit for the new metric being generated.
            unit: <new_metric_unit>

            # type describes how the new metric will be generated. It can be one of `calculate` or `scale`.  calculate generates a metric applying the given operation on two operand metrics. scale operates only on operand1 metric to generate the new metric.
            type: {calculate, scale}

            # This is a required field. This must be a gauge or sum metric.
            metric1: <first_operand_metric>

            # This field is required only if the type is "calculate". When required, this must be a gauge or sum metric.
            metric2: <second_operand_metric>

            # Operation specifies which arithmetic operation to apply. It must be one of the five supported operations.
            operation: {add, subtract, multiply, divide, percent}

設定を完了するには、設定ファイルの service セクションの metrics パイプラインにプロセッサーを含めます。例:

service:
  pipelines:
    metrics:
      processors: [metricsgeneration]

Configuration example: Create a new metric using two existing metrics 🔗

This example creates the new metric pod.cpu.utilized dividing pod.cpu.usage and node.cpu.limit.

rules:
    - name: pod.cpu.utilized
      type: calculate
      metric1: pod.cpu.usage
      metric2: node.cpu.limit
      operation: divide

Configuration example: Create a new metric scaling the value of an existing metric 🔗

This example creates the new metric pod.memory.usage.bytes from the metric pod.memory.usage.megabytes.

rules:
    - name: pod.memory.usage.bytes
      unit: Bytes
      type: scale
      metric1: pod.memory.usage.megabytes
      operation: multiply
      scale_by: 1048576

Using the calculate rule 🔗

Keep in mind the following specific behaviors of the calculate metric generation rule:

  • The created metric has the same type as the metric configured as the first metric.

  • If the metric being created doesn’t have any valid data points it will not be created. This ensures the processor doesn’t emit empty new metrics.

  • If you want to have metric calculations done on data points whose overlapping attributes match, enable the feature gate metricsgeneration.MatchAttributes. This feature gate is disabled by default, meaning the value used for the second metric during the calculations is simply the first data point’s value.

設定 🔗

The following table shows the configuration options for the metricsgeneration processor:

トラブルシューティング 🔗

Splunk Observability Cloudをご利用のお客様で、Splunk Observability Cloudでデータを確認できない場合は、以下の方法でサポートを受けることができます。

Splunk Observability Cloudをご利用のお客様

見込み客および無料トライアルユーザー様

  • Splunk Answers のコミュニティサポートで質問し、回答を得る

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.

このページは 2025年02月11日 に最終更新されました。