-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[receiver/prometheusremotewritereceiver] prometheusremotewritereceiver optimize parsing with pooling strategy and especting MaxRequestBodySize setting #45622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: leiwingqueen <[email protected]>
|
Related issue: #45472 |
Signed-off-by: leiwingqueen <[email protected]>
Signed-off-by: leiwingqueen <[email protected]>
perebaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see a test mocking the behavior that I described here. I think that this is the only way to make sure that we are not “confusing” the client.
| if cfg.MaxRequestBodySize <= 0 { | ||
| cfg.MaxRequestBodySize = defaultMaxRequestBodySize | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are adding a new configuration option, I think that we should update the README.md with that value
| buf := prw.bodyBufferPool.Get().(*bytes.Buffer) | ||
| buf.Reset() | ||
| defer prw.bodyBufferPool.Put(buf) | ||
| maxRequestBodySize := prw.config.MaxRequestBodySize | ||
| limitedReader := io.LimitReader(req.Body, maxRequestBodySize) | ||
| if _, err = buf.ReadFrom(limitedReader); err != nil { | ||
| prw.settings.Logger.Error("Error reading remote-write request body", zapcore.Field{Key: "error", Type: zapcore.ErrorType, Interface: err}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm asking myself how LimitReader could be useful in that use case and be aligned with the receiver's proposal.
I think that this approach has a silent truncation. This is because io.LimitReader just tells our code that the limit was reached and keep processing the messages that were sent on that “limit.” The problem is, maybe, the client is expecting that all metrics should be processed. In that case, we have a silent issue, because when the limiter reaches the limit, it will return EOF instead of an error, and everything will look like a successful delivery (if I understand the code right).
ArthurSens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome changes, thank you! If you could give the output of the benchmark runs, or the benchstat difference instead of the table you provided, that would be awesome too!
| bodyBufferPool: &sync.Pool{ | ||
| New: func() any { | ||
| // Pre-allocate 4KiB | ||
| return bytes.NewBuffer(make([]byte, 0, 4*1024)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to create the buffer with the max_body_size? This way we avoid allocations for requests that are higher than 4KiB 🤔
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Add new util functions to copy data in routing connector. | ||
| note: prometheusremotewritereceiver optimize parsing with pooling strategy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're also adding a new functionality to respect MaxRequestBodySize, right? I think this also deserves some blurbs in the changelog
Signed-off-by: leiwingqueen <[email protected]>
Signed-off-by: leiwingqueen <[email protected]>
Signed-off-by: leiwingqueen <[email protected]>
Signed-off-by: leiwingqueen <[email protected]>
benchstat result goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver
cpu: Apple M4 Pro
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
RemoteWrite/S10_Samples1_C1-14 16.52µ ± 5% 12.87µ ± 3% -22.11% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C4-14 14.60µ ± 8% 11.15µ ± 2% -23.65% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C16-14 10.476µ ± 2% 8.670µ ± 2% -17.24% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C1-14 38.03µ ± 2% 30.14µ ± 3% -20.76% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C4-14 26.08µ ± 1% 23.83µ ± 9% -8.62% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C16-14 18.13µ ± 5% 16.48µ ± 1% -9.11% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C1-14 125.69µ ± 1% 93.33µ ± 2% -25.75% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C4-14 81.73µ ± 2% 62.20µ ± 2% -23.90% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C16-14 48.62µ ± 4% 45.90µ ± 2% -5.60% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C1-14 200.0µ ± 2% 164.5µ ± 3% -17.75% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C4-14 133.4µ ± 1% 116.1µ ± 8% -12.95% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C16-14 107.9µ ± 2% 110.7µ ± 2% +2.60% (p=0.015 n=10)
RemoteWrite/S1000_Samples1_C1-14 482.4µ ± 4% 465.7µ ± 2% -3.45% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C4-14 411.3µ ± 2% 423.9µ ± 3% +3.08% (p=0.011 n=10)
RemoteWrite/S1000_Samples1_C16-14 376.6µ ± 5% 394.0µ ± 6% +4.61% (p=0.029 n=10)
RemoteWrite/S1000_Samples5_C1-14 986.9µ ± 0% 1006.2µ ± 2% +1.95% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C4-14 955.7µ ± 5% 1004.6µ ± 2% +5.11% (p=0.007 n=10)
RemoteWrite/S1000_Samples5_C16-14 919.7µ ± 3% 924.7µ ± 2% ~ (p=0.481 n=10)
geomean 108.3µ 97.22µ -10.26%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
RemoteWrite/S10_Samples1_C1-14 35.09Ki ± 0% 33.80Ki ± 0% -3.66% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C4-14 35.01Ki ± 0% 33.75Ki ± 0% -3.60% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C16-14 34.94Ki ± 0% 33.65Ki ± 0% -3.70% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C1-14 68.33Ki ± 0% 65.71Ki ± 0% -3.83% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C4-14 68.01Ki ± 0% 65.42Ki ± 0% -3.82% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C16-14 67.89Ki ± 0% 65.22Ki ± 0% -3.93% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C1-14 259.7Ki ± 0% 236.4Ki ± 0% -8.99% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C4-14 259.0Ki ± 0% 235.4Ki ± 0% -9.11% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C16-14 258.7Ki ± 0% 235.1Ki ± 0% -9.11% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C1-14 596.8Ki ± 0% 552.9Ki ± 0% -7.36% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C4-14 595.8Ki ± 0% 551.2Ki ± 0% -7.48% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C16-14 595.5Ki ± 0% 551.2Ki ± 0% -7.44% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C1-14 2.654Mi ± 0% 2.385Mi ± 0% -10.13% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C4-14 2.653Mi ± 0% 2.384Mi ± 0% -10.14% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C16-14 2.653Mi ± 0% 2.391Mi ± 0% -9.87% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C1-14 5.955Mi ± 0% 5.470Mi ± 0% -8.14% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C4-14 5.954Mi ± 0% 5.474Mi ± 0% -8.06% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C16-14 5.954Mi ± 0% 5.505Mi ± 0% -7.55% (p=0.000 n=10)
geomean 427.4Ki 397.4Ki -7.03%
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
RemoteWrite/S10_Samples1_C1-14 489.0 ± 0% 488.0 ± 0% -0.20% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C4-14 489.0 ± 0% 488.0 ± 0% -0.20% (p=0.000 n=10)
RemoteWrite/S10_Samples1_C16-14 489.0 ± 0% 488.0 ± 0% -0.20% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C1-14 1.072k ± 0% 1.069k ± 0% -0.28% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C4-14 1.070k ± 0% 1.068k ± 0% -0.19% (p=0.000 n=10)
RemoteWrite/S10_Samples5_C16-14 1.070k ± 0% 1.068k ± 0% -0.19% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C1-14 4.023k ± 0% 4.015k ± 0% -0.20% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C4-14 4.020k ± 0% 4.013k ± 0% -0.17% (p=0.000 n=10)
RemoteWrite/S100_Samples1_C16-14 4.019k ± 0% 4.012k ± 0% -0.17% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C1-14 9.825k ± 0% 9.815k ± 0% -0.10% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C4-14 9.822k ± 0% 9.813k ± 0% -0.09% (p=0.000 n=10)
RemoteWrite/S100_Samples5_C16-14 9.821k ± 0% 9.812k ± 0% -0.09% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C1-14 39.16k ± 0% 39.14k ± 0% -0.04% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C4-14 39.15k ± 0% 39.13k ± 0% -0.04% (p=0.000 n=10)
RemoteWrite/S1000_Samples1_C16-14 39.15k ± 0% 39.13k ± 0% -0.04% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C1-14 97.16k ± 0% 97.14k ± 0% -0.02% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C4-14 97.15k ± 0% 97.14k ± 0% -0.02% (p=0.000 n=10)
RemoteWrite/S1000_Samples5_C16-14 97.15k ± 0% 97.14k ± 0% -0.02% (p=0.000 n=10)
geomean 6.546k 6.537k -0.13%Full benchmark comparisonBefore: goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver
cpu: Apple M4 Pro
BenchmarkRemoteWrite/S10_Samples1_C1-14 79982 16353 ns/op 35928 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 77967 17687 ns/op 35950 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 65244 16404 ns/op 35923 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 112194 16640 ns/op 35932 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 81552 17347 ns/op 35947 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 73909 15323 ns/op 35901 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 76916 16202 ns/op 35927 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 63933 17393 ns/op 35943 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 83409 16705 ns/op 35933 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 85072 15948 ns/op 35909 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 89922 13391 ns/op 35837 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 87920 13485 ns/op 35838 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 83420 14345 ns/op 35851 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 84889 13722 ns/op 35818 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 114372 15290 ns/op 35866 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 70434 15392 ns/op 35867 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 81376 15399 ns/op 35856 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 72685 14925 ns/op 35859 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 76860 14854 ns/op 35853 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 85563 13449 ns/op 35836 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 106363 10705 ns/op 35781 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 114177 10441 ns/op 35781 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 104947 10641 ns/op 35781 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 102068 10463 ns/op 35782 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 111913 10584 ns/op 35782 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 111056 10447 ns/op 35782 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 106915 10479 ns/op 35784 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 111172 10446 ns/op 35784 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 108860 10510 ns/op 35783 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 109543 10473 ns/op 35782 B/op 489 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31423 37785 ns/op 69955 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31134 38312 ns/op 69972 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 30836 37625 ns/op 69951 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 33008 37969 ns/op 69963 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31561 36862 ns/op 69950 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31060 38098 ns/op 69977 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31206 38447 ns/op 69974 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 32674 38541 ns/op 69975 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31892 38109 ns/op 69977 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 31528 37321 ns/op 69948 B/op 1072 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 43378 26330 ns/op 69650 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 47268 26013 ns/op 69643 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45225 26170 ns/op 69647 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45074 25874 ns/op 69644 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 44947 26137 ns/op 69650 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45340 26025 ns/op 69647 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45714 25936 ns/op 69647 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 44588 26627 ns/op 69647 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45376 26028 ns/op 69649 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 45591 26317 ns/op 69647 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 68182 17304 ns/op 69518 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 67198 17673 ns/op 69516 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 66140 17700 ns/op 69518 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 68067 17487 ns/op 69515 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 68796 17224 ns/op 69517 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 67701 19079 ns/op 69521 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 61399 19465 ns/op 69524 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 62721 18559 ns/op 69519 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 58489 18734 ns/op 69519 B/op 1070 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 62805 18731 ns/op 69518 B/op 1070 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9262 126312 ns/op 265965 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 8916 125737 ns/op 265938 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 10000 125879 ns/op 266024 B/op 4024 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 8986 124988 ns/op 265952 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9548 125878 ns/op 265866 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9574 125090 ns/op 265982 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9588 125587 ns/op 265974 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9526 125800 ns/op 265979 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 9672 124904 ns/op 265996 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 8979 125643 ns/op 266009 B/op 4023 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14430 83195 ns/op 265177 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14388 82273 ns/op 265173 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14217 88409 ns/op 265156 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14482 81157 ns/op 265167 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14433 81692 ns/op 265173 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14546 81423 ns/op 265188 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14827 81238 ns/op 265181 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14403 83182 ns/op 265175 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14322 78943 ns/op 265145 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 14550 81778 ns/op 265185 B/op 4020 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 23292 51791 ns/op 264856 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 22455 49076 ns/op 264857 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24313 48505 ns/op 264859 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24762 48512 ns/op 264858 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24793 48605 ns/op 264860 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24681 48402 ns/op 264862 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24700 48948 ns/op 264857 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24408 48410 ns/op 264858 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24357 50795 ns/op 264861 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24565 48636 ns/op 264860 B/op 4019 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5763 205518 ns/op 611144 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5700 202148 ns/op 611163 B/op 9826 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5661 203201 ns/op 611107 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6180 200068 ns/op 611120 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6032 199490 ns/op 611158 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6127 196191 ns/op 611169 B/op 9826 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6260 198818 ns/op 611145 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5749 199428 ns/op 611143 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5728 199894 ns/op 611147 B/op 9825 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 5551 204071 ns/op 611167 B/op 9826 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8260 134516 ns/op 610056 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8949 132704 ns/op 610075 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 7515 133457 ns/op 610069 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 7857 134709 ns/op 610071 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8799 133653 ns/op 610066 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9075 132371 ns/op 610067 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8024 133639 ns/op 610065 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 7696 133074 ns/op 610071 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 7736 131685 ns/op 610077 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 7518 133284 ns/op 610081 B/op 9822 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 11290 106584 ns/op 609811 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 11158 106020 ns/op 609812 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 11314 105974 ns/op 609806 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 11347 107030 ns/op 609805 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10941 108333 ns/op 609808 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10983 111373 ns/op 609810 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10940 110503 ns/op 609812 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10521 107417 ns/op 609809 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10686 109976 ns/op 609811 B/op 9821 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10809 109908 ns/op 609810 B/op 9821 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2432 503154 ns/op 2783212 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2432 489736 ns/op 2783214 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2317 480034 ns/op 2783196 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2384 473668 ns/op 2783140 B/op 39154 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2365 477375 ns/op 2783179 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2403 477087 ns/op 2783222 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2314 500194 ns/op 2783226 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2379 571316 ns/op 2783229 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2390 484676 ns/op 2783193 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2389 477775 ns/op 2783181 B/op 39155 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2961 411271 ns/op 2781985 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2942 411287 ns/op 2781991 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2828 410535 ns/op 2781996 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2917 413146 ns/op 2781977 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 3050 414733 ns/op 2781972 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2883 408098 ns/op 2781988 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2977 419376 ns/op 2781994 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2832 421459 ns/op 2781987 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2811 410932 ns/op 2781987 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2940 410347 ns/op 2782006 B/op 39150 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 3015 376528 ns/op 2781695 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2904 376682 ns/op 2781704 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2976 371892 ns/op 2781700 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 3026 377684 ns/op 2781698 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2980 394521 ns/op 2781704 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2786 437746 ns/op 2781700 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2829 375074 ns/op 2781715 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2974 375478 ns/op 2781692 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2774 374073 ns/op 2781703 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2960 395943 ns/op 2781710 B/op 39149 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1125 972259 ns/op 6244154 B/op 97154 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1180 986923 ns/op 6244188 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1197 987970 ns/op 6244125 B/op 97154 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1176 986534 ns/op 6244292 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1177 983233 ns/op 6244246 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1159 986961 ns/op 6244184 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1191 1004899 ns/op 6244211 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1209 988817 ns/op 6244156 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1172 984152 ns/op 6244266 B/op 97155 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1182 987468 ns/op 6244134 B/op 97154 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1380 952087 ns/op 6243307 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1393 952341 ns/op 6243307 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1293 950612 ns/op 6243294 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1419 963740 ns/op 6243268 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1345 946348 ns/op 6243296 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1408 954862 ns/op 6243317 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1357 956554 ns/op 6243306 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1270 1002851 ns/op 6243317 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1328 1024661 ns/op 6243302 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1348 995974 ns/op 6243301 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1378 928489 ns/op 6243122 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1278 938818 ns/op 6243132 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1414 925419 ns/op 6243125 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1294 914007 ns/op 6243117 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1310 943374 ns/op 6243124 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1310 941943 ns/op 6243120 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1131 902624 ns/op 6243164 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1334 889411 ns/op 6243117 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1255 895857 ns/op 6243138 B/op 97152 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1489 906098 ns/op 6243120 B/op 97152 allocs/op
PASS
ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver 261.875s
After goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver
cpu: Apple M4 Pro
BenchmarkRemoteWrite/S10_Samples1_C1-14 93999 12599 ns/op 34501 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 96447 13133 ns/op 34615 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 86776 12773 ns/op 34608 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 92745 12746 ns/op 34616 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 94785 12961 ns/op 34615 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 86253 13138 ns/op 34626 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 95617 13279 ns/op 34635 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 94718 12777 ns/op 34608 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 87574 13643 ns/op 34649 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C1-14 85171 12448 ns/op 34601 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 109790 10549 ns/op 34532 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 111936 10958 ns/op 34551 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 98263 11211 ns/op 34564 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 109669 11081 ns/op 34553 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 98266 10879 ns/op 34550 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 99178 11331 ns/op 34565 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 102340 11234 ns/op 34560 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 110871 11072 ns/op 34561 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 119475 11741 ns/op 34584 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C4-14 94886 11392 ns/op 34571 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 133440 8643 ns/op 34459 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 137168 8577 ns/op 34457 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 131850 8645 ns/op 34456 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 132786 8857 ns/op 34459 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 133162 8694 ns/op 34457 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 132540 8617 ns/op 34456 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 136261 8559 ns/op 34457 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 131728 8739 ns/op 34457 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 137335 8875 ns/op 34457 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples1_C16-14 132540 8930 ns/op 34459 B/op 488 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 43786 30206 ns/op 67289 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 40467 30887 ns/op 67297 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 38362 30069 ns/op 67279 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 39164 29539 ns/op 67272 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 42493 29906 ns/op 67281 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 39495 30370 ns/op 67303 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 38778 29070 ns/op 67265 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 45717 29700 ns/op 67291 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 38193 31231 ns/op 67339 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C1-14 41122 31049 ns/op 67332 B/op 1069 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 56462 21920 ns/op 66968 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 56010 21569 ns/op 66974 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 52689 21689 ns/op 66979 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 51990 24015 ns/op 66996 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 49507 24416 ns/op 66998 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 48637 24167 ns/op 66985 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 49851 23977 ns/op 66988 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 49117 23691 ns/op 66990 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 49809 23537 ns/op 66987 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C4-14 49591 24085 ns/op 66997 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70305 16529 ns/op 66788 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70081 16295 ns/op 66789 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70905 16425 ns/op 66788 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 71869 16317 ns/op 66789 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70047 16324 ns/op 66790 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70620 16548 ns/op 66790 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 68376 16927 ns/op 66795 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 69698 16633 ns/op 66787 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 70389 16401 ns/op 66788 B/op 1068 allocs/op
BenchmarkRemoteWrite/S10_Samples5_C16-14 71028 16549 ns/op 66790 B/op 1068 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12694 93269 ns/op 242050 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12949 92845 ns/op 242002 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12752 92171 ns/op 242005 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12856 92600 ns/op 242070 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12886 94927 ns/op 242081 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12694 94867 ns/op 242125 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12789 95243 ns/op 242145 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12796 92123 ns/op 242024 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12847 93382 ns/op 242084 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C1-14 12571 93819 ns/op 242002 B/op 4015 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 18457 62345 ns/op 240985 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 18850 63090 ns/op 241017 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19108 62581 ns/op 241022 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19230 62643 ns/op 241009 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19098 61757 ns/op 241035 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 18715 66568 ns/op 241003 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19503 59994 ns/op 240978 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19663 61109 ns/op 241014 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19687 60874 ns/op 241033 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C4-14 19970 62062 ns/op 241026 B/op 4013 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 25429 46098 ns/op 240740 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 25962 45763 ns/op 240728 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 26055 45403 ns/op 240737 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 26077 46230 ns/op 240730 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 26146 45074 ns/op 240730 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 25918 45410 ns/op 240734 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 26066 46167 ns/op 240729 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 25971 46592 ns/op 240734 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 25364 46029 ns/op 240731 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples1_C16-14 24487 44216 ns/op 240738 B/op 4012 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6675 169701 ns/op 566254 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7888 167981 ns/op 566158 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7100 164378 ns/op 566296 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6880 162881 ns/op 566145 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 9694 161395 ns/op 566134 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7046 171970 ns/op 566112 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7398 166134 ns/op 566191 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7321 163807 ns/op 566164 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 7642 164593 ns/op 566305 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C1-14 6908 163819 ns/op 566174 B/op 9815 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9636 114177 ns/op 564422 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8866 113761 ns/op 564435 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9128 113001 ns/op 564427 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9476 112676 ns/op 564446 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9728 113977 ns/op 564414 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9288 118022 ns/op 564421 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8883 126847 ns/op 564440 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 9032 125306 ns/op 564443 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8659 123905 ns/op 564464 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C4-14 8593 125138 ns/op 564508 B/op 9813 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10935 111310 ns/op 564417 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10795 110310 ns/op 564438 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10785 108837 ns/op 564435 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10746 109317 ns/op 564449 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10795 112358 ns/op 564464 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10714 113133 ns/op 564458 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10878 113734 ns/op 564427 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10808 110119 ns/op 564446 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10885 109678 ns/op 564436 B/op 9812 allocs/op
BenchmarkRemoteWrite/S100_Samples5_C16-14 10894 111058 ns/op 564464 B/op 9812 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2496 460218 ns/op 2501650 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2431 456063 ns/op 2501205 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2467 465772 ns/op 2501150 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2392 472641 ns/op 2501276 B/op 39138 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2392 484523 ns/op 2500842 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2335 476487 ns/op 2501643 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2431 465615 ns/op 2501406 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2486 466963 ns/op 2501299 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2472 464431 ns/op 2501106 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C1-14 2470 464208 ns/op 2500741 B/op 39139 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2917 429144 ns/op 2499711 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2755 424840 ns/op 2500425 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2736 434789 ns/op 2499956 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2896 424039 ns/op 2500001 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2725 423840 ns/op 2500290 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2896 411418 ns/op 2499960 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2710 416201 ns/op 2500322 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2995 424261 ns/op 2499635 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 3008 407026 ns/op 2499939 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C4-14 2809 419419 ns/op 2500303 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2671 427174 ns/op 2507513 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2815 394938 ns/op 2507008 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2757 416329 ns/op 2507354 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2853 396329 ns/op 2506891 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 3067 388845 ns/op 2506108 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2721 387991 ns/op 2507482 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2805 392978 ns/op 2506987 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2780 391499 ns/op 2507121 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2714 391239 ns/op 2507423 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples1_C16-14 2890 402228 ns/op 2506689 B/op 39135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1156 1006638 ns/op 5734445 B/op 97137 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1111 1003163 ns/op 5736244 B/op 97138 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1183 1003757 ns/op 5735344 B/op 97137 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1179 1001534 ns/op 5734750 B/op 97137 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1158 1010137 ns/op 5736498 B/op 97138 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1174 1003130 ns/op 5734813 B/op 97137 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1184 1095934 ns/op 5736959 B/op 97137 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1099 1027940 ns/op 5734924 B/op 97138 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1176 1023000 ns/op 5736139 B/op 97138 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C1-14 1112 1005664 ns/op 5736273 B/op 97138 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1389 1060092 ns/op 5739642 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1352 1006747 ns/op 5740488 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1365 1006362 ns/op 5739814 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1467 1002811 ns/op 5739941 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1298 1027107 ns/op 5740324 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1381 998554 ns/op 5739685 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1534 987011 ns/op 5739439 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1389 993930 ns/op 5739986 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1339 1023321 ns/op 5740219 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C4-14 1437 1002175 ns/op 5739426 B/op 97135 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1394 962342 ns/op 5770309 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1287 935497 ns/op 5773770 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1315 918349 ns/op 5771842 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1261 919974 ns/op 5774913 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1440 927052 ns/op 5769150 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1347 938172 ns/op 5772161 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1292 901172 ns/op 5773412 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1416 922442 ns/op 5769663 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1492 909930 ns/op 5767592 B/op 97136 allocs/op
BenchmarkRemoteWrite/S1000_Samples5_C16-14 1225 942220 ns/op 5775860 B/op 97136 allocs/op
PASS
ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusremotewritereceiver 267.160s |
Description
This PR optimizes the Prometheus Remote Write receiver by replacing
io.ReadAll()with a buffer pool pattern, significantly reducing memory allocations and improving throughput in high-traffic scenarios.Key changes:
sync.Poolfor reusable buffers to minimize allocationsio.LimitReaderto properly enforceMaxRequestBodySizeconfigurationPerformance improvements (Apple M4 Pro, 14 cores):
Additional benefits:
Link to tracking issue
Fixes #45623
Testing
go test -benchmemBenchmark command:
go test -bench=BenchmarkRemoteWrite -benchmem -benchtime=1s -cpu=1,4,16Full benchmark comparison
Before:
After:
Documentation
New optional configuration: