Skip to content

Commit 55dade9

Browse files
authored
Performance improvements for the metricstarttime processor (open-telemetry#40998)
#### Description The existing implementation copied everything from the previous resourcemetrics to a completely new resourcemetrics. However, the component is marked as mutating data, so this PR just changes it to mutate the batch of metrics in-place. This avoids a lot of copying. From previous experience caching start times and values, storing attributes and exemplars in a cache is very expensive unless you need them. The second commit adds "minimal copy to" methods to avoid storing attributes and exemplars. #### Link to tracking issue Fixes open-telemetry#39400 #### Testing Passes all existing unit tests.
1 parent 7850ce5 commit 55dade9

File tree

3 files changed

+158
-188
lines changed

3 files changed

+158
-188
lines changed

processor/metricstarttimeprocessor/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metri
33
go 1.23.0
44

55
require (
6+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.129.0
67
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.129.0
78
github.com/stretchr/testify v1.10.0
89
go.opentelemetry.io/collector/component v1.35.1-0.20250710172626-1ebb9b20cfa5
@@ -66,3 +67,7 @@ require (
6667
)
6768

6869
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil
70+
71+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
72+
73+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden

0 commit comments

Comments
 (0)