[Otelsoak] Adds Vercel drain mode for otelsoak - #1347
Merged
Conversation
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
…ponents into vercel_drain_otelsoak
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
gizas
commented
Aug 11, 2026
| # vercelencodingextension reads event time (and log id / SI deviceId) from the | ||
| # drain JSON body, not the OTLP log timestamp loadgen rewrites. Refresh body | ||
| # fields each send so documents keep advancing under concurrency. | ||
| transform/vercel_refresh: |
Contributor
Author
There was a problem hiding this comment.
For the reviewer:
This is used in order to update the timestamp and ids per ingestion and simulate a real ingestion
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
constanca-m
reviewed
Aug 11, 2026
carsonip
reviewed
Aug 11, 2026
carsonip
left a comment
Member
There was a problem hiding this comment.
thanks. did a first pass, will do a more in-depth review later.
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
gizas
marked this pull request as ready for review
August 12, 2026 13:38
carsonip
reviewed
Aug 12, 2026
| continue | ||
| } | ||
| if b.Len() > 0 { | ||
| b.WriteByte('\n') |
Member
There was a problem hiding this comment.
- q: does actual vercel have trailing newlines? Either way, in ndjson spec empty lines should be ignored. We can skip the Len() > 0 check and write
\nimmediately after WriteString - Do we have a test in our receiver that checks our handling of empty lines?
Contributor
Author
There was a problem hiding this comment.
No dont see anything. It works because we have the json.Decoder
|
|
||
| // encodeLogBodies joins each log record body as a line (NDJSON-friendly). | ||
| func encodeLogBodies(ld plog.Logs) []byte { | ||
| var b strings.Builder |
Member
There was a problem hiding this comment.
nit: better perf from bytes.Buffer?
Member
There was a problem hiding this comment.
goos: linux
goarch: amd64
pkg: github.com/elastic/opentelemetry-collector-components/internal/exporter/httpexporter
cpu: AMD Ryzen 7 PRO 8840HS w/ Radeon 780M Graphics
│ /tmp/old.txt │ /tmp/new.txt │
│ sec/op │ sec/op vs base │
Encode/001_records-16 67.75n ± 16% 74.90n ± 32% +10.57% (p=0.037 n=10)
Encode/010_records-16 742.3n ± 10% 744.8n ± 9% ~ (p=0.811 n=10)
Encode/100_records-16 9.397µ ± 8% 4.742µ ± 5% -49.55% (p=0.000 n=10)
geomean 778.9n 641.9n -17.59%
│ /tmp/old.txt │ /tmp/new.txt │
│ B/op │ B/op vs base │
Encode/001_records-16 192.0 ± 0% 144.0 ± 0% -25.00% (p=0.000 n=10)
Encode/010_records-16 3.469Ki ± 0% 2.953Ki ± 0% -14.86% (p=0.000 n=10)
Encode/100_records-16 54.09Ki ± 0% 23.95Ki ± 0% -55.72% (p=0.000 n=10)
geomean 3.277Ki 2.151Ki -34.37%
│ /tmp/old.txt │ /tmp/new.txt │
│ allocs/op │ allocs/op vs base │
Encode/001_records-16 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=10) ¹
Encode/010_records-16 6.000 ± 0% 6.000 ± 0% ~ (p=1.000 n=10) ¹
Encode/100_records-16 13.000 ± 0% 9.000 ± 0% -30.77% (p=0.000 n=10)
geomean 5.383 4.762 -11.54%
¹ all samples are equal
Contributor
Author
There was a problem hiding this comment.
fix bytes changes
changed to use bytes.Buffer
| } | ||
|
|
||
| // encodeLogBodies joins each log record body as a line (NDJSON-friendly). | ||
| func encodeLogBodies(ld plog.Logs) []byte { |
Member
There was a problem hiding this comment.
nit: return (buf bytes.Buffer, empty bool)?
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
…ponents into vercel_drain_otelsoak
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
…try-collector-components into vercel_drain_otelsoak
carsonip
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Runs otelsoak against a Vercel Managed Inputs drain endpoint
So in more details it will try to send HTTP NDJSON via httpexporter.
Speed-insight e2e:

Logs e2e:

Related to https://github.com/elastic/observability-dev/issues/5950