Skip to content

vtinsert,vtagent: return UNAVAILABLE on OTLP/gRPC overload and read-only storage - #332

Closed
aloneangel45 wants to merge 2 commits into
VictoriaMetrics:masterfrom
aloneangel45:fix/otlp-grpc-unavailable-status
Closed

aloneangel45 wants to merge 2 commits into
VictoriaMetrics:masterfrom
aloneangel45:fix/otlp-grpc-unavailable-status

Conversation

@aloneangel45

Copy link
Copy Markdown

Fixes #306

Describe Your Changes

  • Added grpc.StatusCodeFromError(err error) string in lib/grpc/grpc.go, mapping *httpserver.ErrorWithStatusCode overload / rate-limit / unavailability errors (429 Too Many Requests, 503 Service Unavailable, 502, 504) to grpc.StatusCodeUnavailable ("14"), while defaulting other errors to grpc.StatusCodeInternal ("13").
  • Updated app/vtinsert/opentelemetry/otlpgrpc.go to use grpc.StatusCodeFromError(err) for insertutil.CanWriteData() (read-only storage returns HTTP 429) and protoparserutil.ReadUncompressedData (-maxConcurrentInserts concurrency exhaustion returns HTTP 503).
  • Updated app/vtagent/opentelemetry/otlpgrpc.go to use grpc.StatusCodeFromError(err) for protoparserutil.ReadUncompressedData concurrency-limit errors.
  • Added regression tests in lib/grpc/grpc_test.go, app/vtinsert/opentelemetry/otlpgrpc_test.go, and app/vtagent/opentelemetry/otlpgrpc_test.go.

Verification

go vet ./lib/grpc/... ./app/vtinsert/opentelemetry/... ./app/vtagent/opentelemetry/...
go test -v -count=1 ./lib/grpc/... ./app/vtinsert/... ./app/vtagent/...

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files

Reply to a comment to ask cubic a question or push back. It learns from your replies.
Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.

Re-trigger cubic

@aloneangel45

Copy link
Copy Markdown
Author

Thanks for the review! Addressed both findings in the latest commit: saved and restored \maxConcurrentInserts\ and \insert.maxQueueDuration\ via \ .Cleanup\ and checked \ lag.Set\ errors in both \�pp/vtinsert/opentelemetry/otlpgrpc_test.go\ and \�pp/vtagent/opentelemetry/otlpgrpc_test.go.

@f41gh7 f41gh7 closed this Nov 27, 2026
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.

vtinsert: OTLP/gRPC returns INTERNAL when busy, so clients drop spans

2 participants