From 5ef3e9010d756c4f6926b0e04a519c4883c4991a Mon Sep 17 00:00:00 2001 From: Zhou Date: Thu, 7 Nov 2024 09:51:54 -0800 Subject: [PATCH 1/3] Add DotNet runtime metrics transform rules --- .../appsignals_and_ecs_config.yaml | 258 ++++++++++++++++++ .../appsignals_and_eks_config.yaml | 258 ++++++++++++++++++ .../appsignals_and_k8s_config.yaml | 258 ++++++++++++++++++ .../appsignals_fallback_and_eks_config.yaml | 258 ++++++++++++++++++ .../appsignals_over_fallback_config.yaml | 258 ++++++++++++++++++ .../sampleConfig/base_appsignals_config.yaml | 258 ++++++++++++++++++ .../base_appsignals_fallback_config.yaml | 258 ++++++++++++++++++ .../appsignals_runtime_config.yaml | 118 ++++++++ 8 files changed, 1924 insertions(+) diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index 269ffe1816..d3a9838ab1 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -780,6 +780,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 3ad6ee7be8..ee75a06ed3 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index a9a5879fc2..f7767d9eae 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -909,6 +909,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index 3ad6ee7be8..ee75a06ed3 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 3ad6ee7be8..ee75a06ed3 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 2f8b79e011..c0b4b24a6e 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -789,6 +789,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index 0820331549..ae9edf9876 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -785,6 +785,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml b/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml index 80812fdcf3..1f74eee608 100644 --- a/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml +++ b/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml @@ -277,3 +277,121 @@ transforms: - action: add_label new_label: Telemetry.Source new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen0Count + experimental_match_labels: {"generation": "gen0"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen1Count + experimental_match_labels: {"generation": "gen1"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen2Count + experimental_match_labels: {"generation": "gen2"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.duration + action: update + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen0HeapSize + experimental_match_labels: {"generation": "gen0"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen1HeapSize + experimental_match_labels: {"generation": "gen1"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen2HeapSize + experimental_match_labels: {"generation": "gen2"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCLOHHeapSize + experimental_match_labels: {"generation": "loh"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCPOHHeapSize + experimental_match_labels: {"generation": "poh"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.thread_pool.threads.count + action: update + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.thread_pool.queue.length + action: update + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + label_set: [ ] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric From 32fc3cd3b142687153ab2df50a82bd9e233db994 Mon Sep 17 00:00:00 2001 From: Zhou Date: Fri, 8 Nov 2024 11:00:08 -0800 Subject: [PATCH 2/3] Add aggregation mutator --- .../aggregation/aggregation_mutator.go | 67 +++++++++++++++ .../aggregation/aggregation_mutator_test.go | 84 +++++++++++++++++++ .../awsapplicationsignals/processor.go | 21 +++-- 3 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go create mode 100644 plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go diff --git a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go b/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go new file mode 100644 index 0000000000..edb1e5ff13 --- /dev/null +++ b/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go @@ -0,0 +1,67 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package aggregation + +import ( + "context" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +type aggregationType int + +const ( + defaultAggregation aggregationType = iota + lastValueAggregation +) + +// AggregationMutator is used to convert predefined ObservableUpDownCounter metrics to use LastValue aggregation. This +// is necessary for cases where metrics are instrumented as cumulative, yet reported with snapshot values. +// +// For example, metrics like DotNetGCGen0HeapSize may report values such as 1000, 2000, 1000, with cumulative temporality +// When exporters, such as the EMF exporter, detect these as cumulative, they convert the values to deltas, +// resulting in outputs like -, 1000, -1000, which misrepresent the data. +// +// Normally, this issue could be resolved by configuring a view with LastValue aggregation within the SDK. +// However, since the view feature is not fully supported in .NET, this workaround implements the required +// conversion to LastValue aggregation to ensure accurate metric reporting. +// See https://github.com/open-telemetry/opentelemetry-dotnet/issues/2618. +type AggregationMutator struct { + includes map[string]aggregationType +} + +func NewAggregationMutator() AggregationMutator { + return newAggregationMutatorWithConfig(map[string]aggregationType{ + "DotNetGCGen0HeapSize": lastValueAggregation, + "DotNetGCGen1HeapSize": lastValueAggregation, + "DotNetGCGen2HeapSize": lastValueAggregation, + "DotNetGCLOHHeapSize": lastValueAggregation, + "DotNetGCPOHHeapSize": lastValueAggregation, + "DotNetThreadCount": lastValueAggregation, + "DotNetThreadQueueLength": lastValueAggregation, + }) +} + +func newAggregationMutatorWithConfig(includes map[string]aggregationType) AggregationMutator { + return AggregationMutator{ + includes, + } +} + +func (t *AggregationMutator) ProcessMetrics(_ context.Context, m pmetric.Metric, _ pcommon.Map) { + aggType, exists := t.includes[m.Name()] + if !exists || aggType == defaultAggregation { + return + } + switch m.Type() { + case pmetric.MetricTypeSum: + switch aggType { + case lastValueAggregation: + m.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + default: + } + default: + } +} diff --git a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go b/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go new file mode 100644 index 0000000000..0bcfb30a14 --- /dev/null +++ b/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go @@ -0,0 +1,84 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package aggregation + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +func TestAggregationMutator_ProcessMetrics(t *testing.T) { + tests := []struct { + name string + config map[string]aggregationType + metrics []pmetric.Metric + expectedTemporality map[string]pmetric.AggregationTemporality + }{ + { + "testCumulativeToDelta", + map[string]aggregationType{ + "test0": lastValueAggregation, + }, + + []pmetric.Metric{ + generateMetricWithSumAggregation("test0", pmetric.AggregationTemporalityCumulative), + }, + map[string]pmetric.AggregationTemporality{ + "test0": pmetric.AggregationTemporalityDelta, + }, + }, + { + "testNoChange", + map[string]aggregationType{ + "test0": lastValueAggregation, + "test1": defaultAggregation, + }, + []pmetric.Metric{ + generateMetricWithSumAggregation("test0", pmetric.AggregationTemporalityDelta), + generateMetricWithSumAggregation("test1", pmetric.AggregationTemporalityCumulative), + generateMetricWithSumAggregation("test2", pmetric.AggregationTemporalityCumulative), + }, + map[string]pmetric.AggregationTemporality{ + "test0": pmetric.AggregationTemporalityDelta, + "test1": pmetric.AggregationTemporalityCumulative, + "test2": pmetric.AggregationTemporalityCumulative, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t1 *testing.T) { + mutator := newAggregationMutatorWithConfig(tt.config) + + for _, m := range tt.metrics { + mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + assert.Equal(t1, tt.expectedTemporality[m.Name()], m.Sum().AggregationTemporality()) + } + }) + } + + mutator := NewAggregationMutator() + + m := generateMetricWithSumAggregation("DotNetGCGen0HeapSize", pmetric.AggregationTemporalityCumulative) + mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + assert.Equal(t, pmetric.MetricTypeSum, m.Type()) + assert.Equal(t, pmetric.AggregationTemporalityDelta, m.Sum().AggregationTemporality()) + + m.SetEmptyHistogram() + m.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative) + mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + assert.Equal(t, pmetric.MetricTypeHistogram, m.Type()) + assert.Equal(t, pmetric.AggregationTemporalityCumulative, m.Histogram().AggregationTemporality()) + +} + +func generateMetricWithSumAggregation(metricName string, temporality pmetric.AggregationTemporality) pmetric.Metric { + m := pmetric.NewMetrics().ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName(metricName) + m.SetEmptySum() + m.Sum().SetAggregationTemporality(temporality) + return m +} diff --git a/plugins/processors/awsapplicationsignals/processor.go b/plugins/processors/awsapplicationsignals/processor.go index 784ee9dd96..c4a17a52a9 100644 --- a/plugins/processors/awsapplicationsignals/processor.go +++ b/plugins/processors/awsapplicationsignals/processor.go @@ -16,6 +16,7 @@ import ( "golang.org/x/text/language" appsignalsconfig "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/config" + "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/aggregation" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/cardinalitycontrol" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/normalizer" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/prune" @@ -44,14 +45,15 @@ type stopper interface { } type awsapplicationsignalsprocessor struct { - logger *zap.Logger - config *appsignalsconfig.Config - replaceActions *rules.ReplaceActions - allowlistMutators []allowListMutator - metricMutators []attributesMutator - traceMutators []attributesMutator - limiter cardinalitycontrol.Limiter - stoppers []stopper + logger *zap.Logger + config *appsignalsconfig.Config + replaceActions *rules.ReplaceActions + allowlistMutators []allowListMutator + metricMutators []attributesMutator + traceMutators []attributesMutator + limiter cardinalitycontrol.Limiter + aggregationMutator aggregation.AggregationMutator + stoppers []stopper } func (ap *awsapplicationsignalsprocessor) StartMetrics(ctx context.Context, _ component.Host) error { @@ -81,6 +83,8 @@ func (ap *awsapplicationsignalsprocessor) StartMetrics(ctx context.Context, _ co dropper := rules.NewDropper(ap.config.Rules) ap.allowlistMutators = []allowListMutator{pruner, keeper, dropper} + ap.aggregationMutator = aggregation.NewAggregationMutator() + return nil } @@ -143,6 +147,7 @@ func (ap *awsapplicationsignalsprocessor) processMetrics(ctx context.Context, md m.SetName(metricCaser.String(m.Name())) // Ensure metric name is in sentence case } ap.processMetricAttributes(ctx, m, resourceAttributes) + ap.aggregationMutator.ProcessMetrics(ctx, m, resourceAttributes) } } } From 7d48121682e4811be2027c5361781e1d196d9569 Mon Sep 17 00:00:00 2001 From: Zhou Date: Fri, 13 Dec 2024 10:09:16 -0800 Subject: [PATCH 3/3] Rename files --- .../aggregation_mutator.go | 8 ++++---- .../aggregation_mutator_test.go | 11 +++++++---- .../metric_pruner.go => metrichandlers/pruner.go} | 10 +++++----- .../pruner_test.go} | 8 ++++---- plugins/processors/awsapplicationsignals/processor.go | 9 ++++----- 5 files changed, 24 insertions(+), 22 deletions(-) rename plugins/processors/awsapplicationsignals/internal/{aggregation => metrichandlers}/aggregation_mutator.go (91%) rename plugins/processors/awsapplicationsignals/internal/{aggregation => metrichandlers}/aggregation_mutator_test.go (92%) rename plugins/processors/awsapplicationsignals/internal/{prune/metric_pruner.go => metrichandlers/pruner.go} (84%) rename plugins/processors/awsapplicationsignals/internal/{prune/metric_pruner_test.go => metrichandlers/pruner_test.go} (96%) diff --git a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go similarity index 91% rename from plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go index edb1e5ff13..7580168e30 100644 --- a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package aggregation +package metrichandlers import ( "context" @@ -17,16 +17,16 @@ const ( lastValueAggregation ) -// AggregationMutator is used to convert predefined ObservableUpDownCounter metrics to use LastValue aggregation. This +// AggregationMutator is used to convert predefined ObservableUpDownCounter metrics to use LastValue metrichandlers. This // is necessary for cases where metrics are instrumented as cumulative, yet reported with snapshot values. // // For example, metrics like DotNetGCGen0HeapSize may report values such as 1000, 2000, 1000, with cumulative temporality // When exporters, such as the EMF exporter, detect these as cumulative, they convert the values to deltas, // resulting in outputs like -, 1000, -1000, which misrepresent the data. // -// Normally, this issue could be resolved by configuring a view with LastValue aggregation within the SDK. +// Normally, this issue could be resolved by configuring a view with LastValue metrichandlers within the SDK. // However, since the view feature is not fully supported in .NET, this workaround implements the required -// conversion to LastValue aggregation to ensure accurate metric reporting. +// conversion to LastValue metrichandlers to ensure accurate metric reporting. // See https://github.com/open-telemetry/opentelemetry-dotnet/issues/2618. type AggregationMutator struct { includes map[string]aggregationType diff --git a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go similarity index 92% rename from plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go index 0bcfb30a14..31f8f69cfa 100644 --- a/plugins/processors/awsapplicationsignals/internal/aggregation/aggregation_mutator_test.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go @@ -1,9 +1,10 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package aggregation +package metrichandlers import ( + "context" "testing" "github.com/stretchr/testify/assert" @@ -49,12 +50,14 @@ func TestAggregationMutator_ProcessMetrics(t *testing.T) { }, }, } + + ctx := context.Background() for _, tt := range tests { t.Run(tt.name, func(t1 *testing.T) { mutator := newAggregationMutatorWithConfig(tt.config) for _, m := range tt.metrics { - mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) assert.Equal(t1, tt.expectedTemporality[m.Name()], m.Sum().AggregationTemporality()) } }) @@ -63,13 +66,13 @@ func TestAggregationMutator_ProcessMetrics(t *testing.T) { mutator := NewAggregationMutator() m := generateMetricWithSumAggregation("DotNetGCGen0HeapSize", pmetric.AggregationTemporalityCumulative) - mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) assert.Equal(t, pmetric.MetricTypeSum, m.Type()) assert.Equal(t, pmetric.AggregationTemporalityDelta, m.Sum().AggregationTemporality()) m.SetEmptyHistogram() m.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative) - mutator.ProcessMetrics(nil, m, pcommon.NewMap()) + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) assert.Equal(t, pmetric.MetricTypeHistogram, m.Type()) assert.Equal(t, pmetric.AggregationTemporalityCumulative, m.Histogram().AggregationTemporality()) diff --git a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go similarity index 84% rename from plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go index 31e5d5a048..acd342afc8 100644 --- a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package prune +package metrichandlers import ( "errors" @@ -12,10 +12,10 @@ import ( "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/common" ) -type MetricPruner struct { +type Pruner struct { } -func (p *MetricPruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { +func (p *Pruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { for _, attributeKey := range common.CWMetricAttributes { if val, ok := attributes.Get(attributeKey); ok { if !isAsciiPrintable(val.Str()) { @@ -29,8 +29,8 @@ func (p *MetricPruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { return false, nil } -func NewPruner() *MetricPruner { - return &MetricPruner{} +func NewPruner() *Pruner { + return &Pruner{} } func isAsciiPrintable(val string) bool { diff --git a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go similarity index 96% rename from plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go index 3f715b4e87..e88c6cd33d 100644 --- a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package prune +package metrichandlers import ( "testing" @@ -41,7 +41,7 @@ func TestMetricPrunerWithIndexableAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.MetricAttributeTelemetrySource, "UnitTest") @@ -72,7 +72,7 @@ func TestMetricPrunerWithNonIndexableAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.MetricAttributeTelemetrySource, "UnitTest") @@ -99,7 +99,7 @@ func TestMetricPrunerWithNoTelemetrySourceAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.AttributeEC2InstanceId, tt.val) diff --git a/plugins/processors/awsapplicationsignals/processor.go b/plugins/processors/awsapplicationsignals/processor.go index c4a17a52a9..adc85f6bcb 100644 --- a/plugins/processors/awsapplicationsignals/processor.go +++ b/plugins/processors/awsapplicationsignals/processor.go @@ -16,10 +16,9 @@ import ( "golang.org/x/text/language" appsignalsconfig "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/config" - "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/aggregation" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/cardinalitycontrol" + "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/metrichandlers" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/normalizer" - "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/prune" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/resolver" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/rules" ) @@ -52,7 +51,7 @@ type awsapplicationsignalsprocessor struct { metricMutators []attributesMutator traceMutators []attributesMutator limiter cardinalitycontrol.Limiter - aggregationMutator aggregation.AggregationMutator + aggregationMutator metrichandlers.AggregationMutator stoppers []stopper } @@ -78,12 +77,12 @@ func (ap *awsapplicationsignalsprocessor) StartMetrics(ctx context.Context, _ co ap.replaceActions = rules.NewReplacer(ap.config.Rules, !limiterConfig.Disabled) - pruner := prune.NewPruner() + pruner := metrichandlers.NewPruner() keeper := rules.NewKeeper(ap.config.Rules, !limiterConfig.Disabled) dropper := rules.NewDropper(ap.config.Rules) ap.allowlistMutators = []allowListMutator{pruner, keeper, dropper} - ap.aggregationMutator = aggregation.NewAggregationMutator() + ap.aggregationMutator = metrichandlers.NewAggregationMutator() return nil }