diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 2e3f984619..a2e58a07ea 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -111,7 +111,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -597,6 +597,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -677,6 +912,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index 13c8c753bb..df5c50f07e 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -111,7 +111,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -597,6 +597,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -657,6 +892,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index 2e3f984619..a2e58a07ea 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -111,7 +111,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -597,6 +597,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -677,6 +912,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 2e3f984619..a2e58a07ea 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -111,7 +111,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -597,6 +597,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -677,6 +912,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 13af9bab01..99c0234da5 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -81,7 +81,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -457,6 +457,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: otlp/application_signals: protocols: @@ -490,6 +725,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals traces/application_signals: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index c0a92f3be1..70fdb9ceb5 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -81,7 +81,7 @@ exporters: regex: '^RuntimeMetric$' separator: ; metric_name_selectors: - - '^.*$' + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -453,6 +453,241 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 + metricstransform: + transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + aggregation_type: "" + submatch_case: "" + match_type: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": '.*Old\\sGen$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Survivor\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": '.*Eden\\sSpace$'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": '(.|\\s)*\\S(.|\\s)*'} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + aggregation_type: "" + submatch_case: "" + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: otlp/application_signals: protocols: @@ -485,6 +720,7 @@ service: processors: - resourcedetection - awsapplicationsignals + - metricstransform receivers: - otlp/application_signals traces/application_signals: diff --git a/translator/tocwconfig/tocwconfig_test.go b/translator/tocwconfig/tocwconfig_test.go index f598beed48..901257205b 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -674,7 +674,7 @@ func verifyToYamlTranslation(t *testing.T, input interface{}, expectedYamlFilePa opt := cmpopts.SortSlices(func(x, y interface{}) bool { return pretty.Sprint(x) < pretty.Sprint(y) }) - //assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML + // assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML require.True(t, cmp.Equal(expected, actual, opt), "D! YAML diff: %s", cmp.Diff(expected, actual)) } diff --git a/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml b/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml index 6f24364bba..cbb4b8f0da 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml @@ -43,4 +43,4 @@ metric_declarations: - Telemetry.Source regex: '^RuntimeMetric$' metric_name_selectors: - - '^.*$' \ No newline at end of file + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' \ No newline at end of file diff --git a/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml b/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml index 57d10c5c6b..3b07a49297 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml @@ -38,4 +38,4 @@ metric_declarations: - Telemetry.Source regex: '^RuntimeMetric$' metric_name_selectors: - - '^.*$' \ No newline at end of file + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' \ No newline at end of file diff --git a/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml b/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml index 05ea848fff..f655ea148b 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml @@ -43,4 +43,4 @@ metric_declarations: - Telemetry.Source regex: '^RuntimeMetric$' metric_name_selectors: - - '^.*$' \ No newline at end of file + - '^(JVMGCDuration|JVMGCCount|JVMGCOldGenDuration|JVMGCOldGenCount|JVMGCYoungGenDuration|JVMGCYoungGenCount|JVMMemoryHeapUsed|JVMMemoryNonHeapUsed|JVMMemoryUsedAfterLastGC|JVMMemoryOldGenUsed|JVMMemorySurvivorSpaceUsed|JVMMemoryEdenSpaceUsed|JVMThreadCount|JVMClassLoaded|JVMCpuTime|JVMCpuRecentUtilization)$' \ No newline at end of file diff --git a/translator/translate/otel/pipeline/applicationsignals/translator.go b/translator/translate/otel/pipeline/applicationsignals/translator.go index bc922faab9..cc726a0f37 100644 --- a/translator/translate/otel/pipeline/applicationsignals/translator.go +++ b/translator/translate/otel/pipeline/applicationsignals/translator.go @@ -15,6 +15,7 @@ import ( "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/exporter/debug" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/awsproxy" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/appsignalsmetricstransformprocessor" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/awsapplicationsignals" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/resourcedetection" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/receiver/otlp" @@ -51,7 +52,10 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators Exporters: common.NewTranslatorMap[component.Config](), Extensions: common.NewTranslatorMap[component.Config](), } - + + if t.dataType == component.DataTypeMetrics { + translators.Processors.Set(appsignalsmetricstransformprocessor.NewTranslator(appsignalsmetricstransformprocessor.WithDataType(t.dataType))) + } translators.Processors.Set(resourcedetection.NewTranslator(resourcedetection.WithDataType(t.dataType))) translators.Processors.Set(awsapplicationsignals.NewTranslator(awsapplicationsignals.WithDataType(t.dataType))) diff --git a/translator/translate/otel/pipeline/applicationsignals/translator_test.go b/translator/translate/otel/pipeline/applicationsignals/translator_test.go index 3373da7ec3..650a8e98c8 100644 --- a/translator/translate/otel/pipeline/applicationsignals/translator_test.go +++ b/translator/translate/otel/pipeline/applicationsignals/translator_test.go @@ -125,7 +125,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { }, want: &want{ receivers: []string{"otlp/application_signals"}, - processors: []string{"resourcedetection", "awsapplicationsignals"}, + processors: []string{"metricstransform", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsemf/application_signals"}, extensions: []string{"agenthealth/logs"}, }, @@ -145,7 +145,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { }, want: &want{ receivers: []string{"otlp/application_signals"}, - processors: []string{"resourcedetection", "awsapplicationsignals"}, + processors: []string{"metricstransform", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"debug/application_signals", "awsemf/application_signals"}, extensions: []string{"agenthealth/logs"}, }, @@ -162,7 +162,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { }, want: &want{ receivers: []string{"otlp/application_signals"}, - processors: []string{"resourcedetection", "awsapplicationsignals"}, + processors: []string{"metricstransform", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsemf/application_signals"}, extensions: []string{"agenthealth/logs"}, }, @@ -220,7 +220,7 @@ func TestTranslatorMetricsForEC2(t *testing.T) { }, want: &want{ receivers: []string{"otlp/application_signals"}, - processors: []string{"resourcedetection", "awsapplicationsignals"}, + processors: []string{"metricstransform", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsemf/application_signals"}, extensions: []string{"agenthealth/logs"}, }, @@ -240,7 +240,7 @@ func TestTranslatorMetricsForEC2(t *testing.T) { }, want: &want{ receivers: []string{"otlp/application_signals"}, - processors: []string{"resourcedetection", "awsapplicationsignals"}, + processors: []string{"metricstransform", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"debug/application_signals", "awsemf/application_signals"}, extensions: []string{"agenthealth/logs"}, }, diff --git a/translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsJvmRuntimeConfig.yaml b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsJvmRuntimeConfig.yaml new file mode 100644 index 0000000000..293465c86d --- /dev/null +++ b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsJvmRuntimeConfig.yaml @@ -0,0 +1,131 @@ +transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.pool.used_after_last_gc + action: insert + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryOldGenUsed + match_type: regexp + experimental_match_labels: {"name": ".*Old\\sGen$"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemorySurvivorSpaceUsed + match_type: regexp + experimental_match_labels: {"name": ".*Survivor\\sSpace$"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.pool.used + action: insert + new_name: JVMMemoryEdenSpaceUsed + match_type: regexp + experimental_match_labels: {"name": ".*Eden\\sSpace$"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + match_type: regexp + experimental_match_labels: {"name": "(.|\\s)*\\S(.|\\s)*"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + match_type: regexp + experimental_match_labels: {"name": "(.|\\s)*\\S(.|\\s)*"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCOldGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCOldGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Old Generation"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCYoungGenDuration + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCYoungGenCount + match_type: strict + experimental_match_labels: {"name": "G1 Young Generation"} + operations: + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric \ No newline at end of file diff --git a/translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go new file mode 100644 index 0000000000..c93636b291 --- /dev/null +++ b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go @@ -0,0 +1,60 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package appsignalsmetricstransformprocessor + +import ( + _ "embed" + + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/processor" +) + +//go:embed config/appSignalsJvmRuntimeConfig.yaml +var appSignalsJvmRuntimeConfig string + +type translator struct { + name string + dataType component.DataType + factory processor.Factory +} + +type Option interface { + apply(t *translator) +} + +type optionFunc func(t *translator) + +func (o optionFunc) apply(t *translator) { + o(t) +} + +// WithDataType determines where the translator should look to find +// the configuration. +func WithDataType(dataType component.DataType) Option { + return optionFunc(func(t *translator) { + t.dataType = dataType + }) +} + +var _ common.Translator[component.Config] = (*translator)(nil) + +func NewTranslator(opts ...Option) common.Translator[component.Config] { + t := &translator{factory: metricstransformprocessor.NewFactory()} + for _, opt := range opts { + opt.apply(t) + } + return t +} + +func (t *translator) ID() component.ID { + return component.NewIDWithName(t.factory.Type(), t.name) +} + +func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { + cfg := t.factory.CreateDefaultConfig().(*metricstransformprocessor.Config) + return common.GetYamlFileToYamlConfig(cfg, appSignalsJvmRuntimeConfig) +}