Skip to content

[Otelsoak] Adds Vercel drain mode for otelsoak - #1347

Merged
gizas merged 15 commits into
mainfrom
vercel_drain_otelsoak
Aug 13, 2026
Merged

[Otelsoak] Adds Vercel drain mode for otelsoak#1347
gizas merged 15 commits into
mainfrom
vercel_drain_otelsoak

Conversation

@gizas

@gizas gizas commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This Runs otelsoak against a Vercel Managed Inputs drain endpoint
So in more details it will try to send HTTP NDJSON via httpexporter.

Optional: VERCEL_SIGNAL=logs|speed_insights|both (default logs)

ELASTIC_SERVER_URL=https://keepandreasgkizasloadtest4-db99da.ingest.eu-central-1.aws.staging.elastic.cloud \\nELASTIC_APM_API_KEY=<key> make otelsoak-run-vercel VERCEL_SIGNAL=both 

Speed-insight e2e:
Screenshot 2026-08-11 at 3 07 47 PM

Logs e2e:
Screenshot 2026-08-11 at 3 07 54 PM

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

gizas added 5 commits August 11, 2026 13:56
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>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
@gizas
gizas requested review from a team as code owners August 11, 2026 12:13
@gizas
gizas requested review from intuibase and mauri870 August 11, 2026 12:13
@gizas
gizas marked this pull request as draft August 11, 2026 12:13
# 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:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
gizas added 2 commits August 11, 2026 15:38
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Comment thread internal/exporter/httpexporter/exporter.go Outdated

@carsonip carsonip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. did a first pass, will do a more in-depth review later.

Comment thread internal/exporter/httpexporter/README.md
Comment thread Makefile Outdated
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
@gizas
gizas marked this pull request as ready for review August 12, 2026 13:38
continue
}
if b.Len() > 0 {
b.WriteByte('\n')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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 \n immediately after WriteString
  • Do we have a test in our receiver that checks our handling of empty lines?

@gizas gizas Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No dont see anything. It works because we have the json.Decoder

func newVercelJSONDecoder(reader io.Reader) *json.Decoder {


// encodeLogBodies joins each log record body as a line (NDJSON-friendly).
func encodeLogBodies(ld plog.Logs) []byte {
var b strings.Builder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: better perf from bytes.Buffer?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: return (buf bytes.Buffer, empty bool)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread receiver/loadgenreceiver/config.go
Comment thread Makefile Outdated
gizas and others added 5 commits August 12, 2026 18:56
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
…try-collector-components into vercel_drain_otelsoak
@gizas
gizas merged commit bca1b53 into main Aug 13, 2026
16 of 19 checks passed
@gizas
gizas deleted the vercel_drain_otelsoak branch August 13, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants