Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -597,7 +598,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -750,7 +751,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -751,7 +752,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -750,7 +751,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -750,7 +751,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -627,7 +628,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand All @@ -617,7 +618,8 @@ processors:
aggregation_type: sum
experimental_scale: 0
label: ""
label_set: []
label_set:
- name
label_value: ""
new_label: ""
new_value: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ transforms:
new_name: JVMGCDuration
operations:
- action: aggregate_labels
label_set: []
label_set: ["name"]
aggregation_type: sum
- action: add_label
new_label: Telemetry.Source
Expand All @@ -120,7 +120,7 @@ transforms:
new_name: JVMGCCount
operations:
- action: aggregate_labels
label_set: []
label_set: ["name"]
aggregation_type: sum
- action: add_label
new_label: Telemetry.Source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,35 @@ func TestAppSignalsRuntime(t *testing.T) {
assert.True(t, ok)
assert.Equal(t, len(expectedCfg.Transforms), len(actualCfg.Transforms))
}

func TestAppSignalsGCMetricsPreserveNameLabel(t *testing.T) {
transl := NewTranslatorWithName(common.AppSignals).(*translator)
conf := confmap.NewFromStringMap(testutil.GetJson(t, filepath.Join("testdata", "appsignals_config.json")))
translatedCfg, err := transl.Translate(conf)
require.NoError(t, err)
actualCfg, ok := translatedCfg.(*metricstransformprocessor.Config)
require.True(t, ok)

// Verify that JVMGCCount and JVMGCDuration transforms preserve the "name" label
// (jvm.gc.name attribute) so Topology can distinguish GC collector types.
gcMetrics := map[string]bool{
"JVMGCCount": false,
"JVMGCDuration": false,
}

for _, transform := range actualCfg.Transforms {
if _, isGCMetric := gcMetrics[transform.NewName]; isGCMetric {
for _, op := range transform.Operations {
if op.Action == "aggregate_labels" {
assert.Contains(t, op.LabelSet, "name",
"Transform %s must preserve 'name' label (jvm.gc.name) for GC collector differentiation", transform.NewName)
gcMetrics[transform.NewName] = true
}
}
}
}

for metricName, found := range gcMetrics {
assert.True(t, found, "Expected to find transform with aggregate_labels operation for %s", metricName)
}
}
Loading