Skip to content

Commit f4df84c

Browse files
committed
adapt transform processor
Signed-off-by: odubajDT <[email protected]>
1 parent 9276376 commit f4df84c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

processor/transformprocessor/internal/logs/processor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func Test_ProcessLogs_LogContext(t *testing.T) {
408408
},
409409
},
410410
{
411-
statement: `merge_maps(attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where body == "operationA"`,
411+
statement: `merge_maps(attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where body == "operationA"`,
412412
want: func(td plog.Logs) {
413413
td.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Attributes().PutStr("json_test", "pass")
414414
},
@@ -662,7 +662,7 @@ func Test_ProcessLogs_InferredLogContext(t *testing.T) {
662662
},
663663
},
664664
{
665-
statement: `merge_maps(log.attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where log.body == "operationA"`,
665+
statement: `merge_maps(log.attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where log.body == "operationA"`,
666666
want: func(td plog.Logs) {
667667
td.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Attributes().PutStr("json_test", "pass")
668668
},

processor/transformprocessor/internal/metrics/processor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ func Test_ProcessMetrics_DataPointContext(t *testing.T) {
949949
},
950950
},
951951
{
952-
statements: []string{`merge_maps(attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where metric.name == "operationA"`},
952+
statements: []string{`merge_maps(attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where metric.name == "operationA"`},
953953
want: func(td pmetric.Metrics) {
954954
td.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(0).Attributes().PutStr("json_test", "pass")
955955
td.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(1).Attributes().PutStr("json_test", "pass")
@@ -1392,7 +1392,7 @@ func Test_ProcessMetrics_InferredDataPointContext(t *testing.T) {
13921392
},
13931393
},
13941394
{
1395-
statements: []string{`merge_maps(datapoint.attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where metric.name == "operationA"`},
1395+
statements: []string{`merge_maps(datapoint.attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where metric.name == "operationA"`},
13961396
want: func(td pmetric.Metrics) {
13971397
td.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(0).Attributes().PutStr("json_test", "pass")
13981398
td.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(1).Attributes().PutStr("json_test", "pass")

processor/transformprocessor/internal/traces/processor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func Test_ProcessTraces_TraceContext(t *testing.T) {
459459
},
460460
},
461461
{
462-
statement: `merge_maps(attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where name == "operationA"`,
462+
statement: `merge_maps(attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where name == "operationA"`,
463463
want: func(td ptrace.Traces) {
464464
td.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes().PutStr("json_test", "pass")
465465
},
@@ -759,7 +759,7 @@ func Test_ProcessTraces_InferredTraceContext(t *testing.T) {
759759
},
760760
},
761761
{
762-
statement: `merge_maps(span.attributes, ParseJSON("{\"json_test\":\"pass\"}"), "insert") where span.name == "operationA"`,
762+
statement: `merge_maps(span.attributes, "insert", ParseJSON("{\"json_test\":\"pass\"}")) where span.name == "operationA"`,
763763
want: func(td ptrace.Traces) {
764764
td.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes().PutStr("json_test", "pass")
765765
},

0 commit comments

Comments
 (0)