From 0a8dec354c109f90d825805da82a141109c08007 Mon Sep 17 00:00:00 2001 From: Reno Date: Fri, 16 Aug 2024 13:06:27 -0700 Subject: [PATCH] feat: Support runtime metrics --- .../normalizer/attributesnormalizer.go | 4 + .../normalizer/attributesnormalizer_test.go | 5 + .../awsapplicationsignals/processor.go | 6 +- .../appsignals_and_eks_config.yaml | 505 ++++++++++++++++++ .../appsignals_and_k8s_config.yaml | 505 ++++++++++++++++++ .../appsignals_fallback_and_eks_config.yaml | 505 ++++++++++++++++++ .../appsignals_over_fallback_config.yaml | 505 ++++++++++++++++++ .../sampleConfig/base_appsignals_config.yaml | 505 ++++++++++++++++++ .../base_appsignals_fallback_config.yaml | 505 ++++++++++++++++++ .../awsemf/appsignals_config_eks.yaml | 10 +- .../awsemf/appsignals_config_generic.yaml | 10 +- .../awsemf/appsignals_config_k8s.yaml | 10 +- .../pipeline/applicationsignals/translator.go | 6 +- .../applicationsignals/translator_test.go | 10 +- .../config/appSignalsRuntimeConfig.yaml | 243 +++++++++ .../translator.go | 60 +++ 16 files changed, 3384 insertions(+), 10 deletions(-) create mode 100644 translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsRuntimeConfig.yaml create mode 100644 translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go diff --git a/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer.go b/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer.go index 5a63743d81..4d4907f51d 100644 --- a/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer.go +++ b/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer.go @@ -121,6 +121,10 @@ func (n *attributesNormalizer) copyResourceAttributesToAttributes(attributes, re } } } + // runtime metrics do not have service attribute, so need to manually add + if serviceAttribute, ok := resourceAttributes.Get("aws.local.service"); ok { + attributes.PutStr("aws.local.service", serviceAttribute.AsString()) + } } func (n *attributesNormalizer) normalizeTelemetryAttributes(attributes, resourceAttributes pcommon.Map, isTrace bool) { diff --git a/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer_test.go b/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer_test.go index 9819328455..57f6aa0ea4 100644 --- a/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer_test.go +++ b/plugins/processors/awsapplicationsignals/internal/normalizer/attributesnormalizer_test.go @@ -90,6 +90,7 @@ func TestCopyResourceAttributesToAttributes(t *testing.T) { resourceAttributes.PutStr(resourceAttrKey, attrKey+"-value") } resourceAttributes.PutStr("host.id", "i-01ef7d37f42caa168") + resourceAttributes.PutStr("aws.local.service", "PetClinic") // Create a pcommon.Map for attributes attributes := pcommon.NewMap() @@ -107,6 +108,10 @@ func TestCopyResourceAttributesToAttributes(t *testing.T) { if value, ok := attributes.Get("K8s.Node"); !ok || value.AsString() != "i-01ef7d37f42caa168" { t.Errorf("Attribute was not copied correctly: got %v, want %v", value.AsString(), "i-01ef7d37f42caa168") } + + if value, ok := attributes.Get("aws.local.service"); !ok || value.AsString() != "PetClinic" { + t.Errorf("Attribute was not copied correctly: got %v, want %v", value.AsString(), "PetClinic") + } } func TestTruncateAttributes(t *testing.T) { diff --git a/plugins/processors/awsapplicationsignals/processor.go b/plugins/processors/awsapplicationsignals/processor.go index 8fc3e25bb7..784ee9dd96 100644 --- a/plugins/processors/awsapplicationsignals/processor.go +++ b/plugins/processors/awsapplicationsignals/processor.go @@ -5,6 +5,7 @@ package awsapplicationsignals import ( "context" + "unicode" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pcommon" @@ -137,7 +138,10 @@ func (ap *awsapplicationsignalsprocessor) processMetrics(ctx context.Context, md metrics := ils.Metrics() for k := 0; k < metrics.Len(); k++ { m := metrics.At(k) - m.SetName(metricCaser.String(m.Name())) // Ensure metric name is in sentence case + // Check if the first letter of the metric name is not capitalized + if len(m.Name()) > 0 && !unicode.IsUpper(rune(m.Name()[0])) { + m.SetName(metricCaser.String(m.Name())) // Ensure metric name is in sentence case + } ap.processMetricAttributes(ctx, m, resourceAttributes) } } diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 0993f8e186..76d6169fc1 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -103,6 +103,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -588,6 +597,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -666,6 +1170,7 @@ service: exporters: - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index 8c903638ea..1d9a315ebe 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -103,6 +103,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -588,6 +597,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -646,6 +1150,7 @@ service: exporters: - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index 0993f8e186..76d6169fc1 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -103,6 +103,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -588,6 +597,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -666,6 +1170,7 @@ service: exporters: - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 0993f8e186..76d6169fc1 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -103,6 +103,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -588,6 +597,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -666,6 +1170,7 @@ service: exporters: - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 49bde8162f..65858f0ca4 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -73,6 +73,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -448,6 +457,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: otlp/application_signals: protocols: @@ -479,6 +983,7 @@ service: - debug/application_signals - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index af5b0a3f4d..6b511a7303 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -73,6 +73,15 @@ exporters: - Latency - Fault - Error + - dimensions: + - [ Environment, Service ] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + separator: ; + metric_name_selectors: + - '^.*$' middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -444,6 +453,501 @@ 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: "" + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + experimental_match_labels: {"type": "vms"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + experimental_match_labels: {"type": "rss"} + match_type: regexp + aggregation_type: "" + submatch_case: "" + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + experimental_scale: 0 + label: "" + new_label: "" + label_value: "" + new_value: "" + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" receivers: otlp/application_signals: protocols: @@ -474,6 +978,7 @@ service: exporters: - awsemf/application_signals processors: + - metricstransform - resourcedetection - awsapplicationsignals receivers: diff --git a/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml b/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml index 036c519717..6f24364bba 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_eks.yaml @@ -35,4 +35,12 @@ metric_declarations: metric_name_selectors: - Latency - Fault - - Error \ No newline at end of file + - Error + - dimensions: + - [Environment, Service] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + metric_name_selectors: + - '^.*$' \ 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 735f6df7da..57d10c5c6b 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_generic.yaml @@ -30,4 +30,12 @@ metric_declarations: metric_name_selectors: - Latency - Fault - - Error \ No newline at end of file + - Error + - dimensions: + - [Environment, Service] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + metric_name_selectors: + - '^.*$' \ 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 ce85e50f78..05ea848fff 100644 --- a/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml +++ b/translator/translate/otel/exporter/awsemf/appsignals_config_k8s.yaml @@ -35,4 +35,12 @@ metric_declarations: metric_name_selectors: - Latency - Fault - - Error \ No newline at end of file + - Error + - dimensions: + - [Environment, Service] + label_matchers: + - label_names: + - Telemetry.Source + regex: '^RuntimeMetric$' + metric_name_selectors: + - '^.*$' \ 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/appSignalsRuntimeConfig.yaml b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsRuntimeConfig.yaml new file mode 100644 index 0000000000..f72d37808d --- /dev/null +++ b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/config/appSignalsRuntimeConfig.yaml @@ -0,0 +1,243 @@ +transforms: + - include: jvm.cpu.recent_utilization + action: insert + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.cpu.time + action: insert + new_name: JVMCpuTime + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.classes.loaded + action: insert + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.threads.count + action: insert + new_name: JVMThreadCount + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.nonheap.used + action: insert + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.memory.heap.used + action: insert + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.elapsed + action: insert + new_name: JVMGCDuration + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: jvm.gc.collections.count + action: insert + new_name: JVMGCCount + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - 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: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.gc_count$$ + action: insert + new_name: PythonProcessGCCount + match_type: regexp + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.thread_count$$ + action: insert + new_name: PythonProcessThreadCount + match_type: regexp + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.cpu_time$$ + action: insert + new_name: PythonProcessCpuTime + match_type: regexp + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + action: insert + new_name: PythonProcessCpuUtilization + match_type: regexp + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessVMSMemoryUsed + match_type: regexp + experimental_match_labels: {"type": "vms"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: ^process\.runtime\.(.*)\.memory$$ + action: insert + new_name: PythonProcessRSSMemoryUsed + match_type: regexp + experimental_match_labels: {"type": "rss"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: mean + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric diff --git a/translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go b/translator/translate/otel/processor/appsignalsmetricstransformprocessor/translator.go new file mode 100644 index 0000000000..5f70cf803d --- /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/appSignalsRuntimeConfig.yaml +var appSignalsRuntimeConfig 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, appSignalsRuntimeConfig) +}