diff --git a/pkg/models/target_write_result_test.go b/pkg/models/target_write_result_test.go index c012be26..eb7f3c13 100644 --- a/pkg/models/target_write_result_test.go +++ b/pkg/models/target_write_result_test.go @@ -166,7 +166,7 @@ func TestNewTargetWriteResult_WithMessages(t *testing.T) { assert.Equal(time.Duration(65)*time.Minute, r3.AvgE2ELatency) } -// TestNewTargetWriteResult_NoTransformation tests that reporting of statistics is as it should be when we don't have a timeTransformed and no collector timestamp +// TestNewTargetWriteResult_NoTransformation_NoE2E tests that reporting of statistics is as it should be when we don't have a timeTransformed and no collector timestamp func TestNewTargetWriteResult_NoTransformation_NoE2E(t *testing.T) { assert := assert.New(t) diff --git a/pkg/transform/transformconfig/transform_config.go b/pkg/transform/transformconfig/transform_config.go index 205224ca..aba656fe 100644 --- a/pkg/transform/transformconfig/transform_config.go +++ b/pkg/transform/transformconfig/transform_config.go @@ -40,6 +40,10 @@ var SupportedTransformations = []config.ConfigurationPair{ func GetTransformations(c *config.Config, supportedTransformations []config.ConfigurationPair) (transform.TransformationApplyFunction, error) { funcs := make([]transform.TransformationFunction, 0) + if c.Data.Metrics.E2ELatencyEnabled { + funcs = append(funcs, transform.CollectorTstampTransformation()) + } + for _, transformation := range c.Data.Transformations { useTransf := transformation.Use @@ -66,9 +70,5 @@ func GetTransformations(c *config.Config, supportedTransformations []config.Conf funcs = append(funcs, f) } - if c.Data.Metrics.E2ELatencyEnabled { - funcs = append(funcs, transform.CollectorTstampTransformation()) - } - return transform.NewTransformation(funcs...), nil }