fix: don't mark successful plugin responses as span errors - #8685
Open
znnnnnnn-wil wants to merge 1 commit into
Open
fix: don't mark successful plugin responses as span errors#8685znnnnnnn-wil wants to merge 1 commit into
znnnnnnn-wil wants to merge 1 commit into
Conversation
|
SentinelOne CNS Hardcoded Secret Detector SentinelOne CNS is a cloud-agnostic, agentless CSPM & CWPP solution that continuously detects and prevents vulnerabilities that have the highest probability of being exploited in Azure, AWS, Google Cloud, and Kubernetes. |
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.
Description
Stops
TraceMiddleware.ProcessRequestfrom setting the OpenTelemetry span status toErrorwhen middleware returnsErrResponseSucceed.ErrResponseSucceedmeans a Go plugin successfully wrote the response and intentionally terminated the middleware chain. The check useserrors.Is, so wrapped sentinels are handled too. Real failures—includingErrResponseErrorSentfor plugin-written 4xx/5xx responses—remain span errors.Related Issue
Fixes #8684
Motivation and Context
Successful plugin-served 2xx responses currently record the correct HTTP status but an OpenTelemetry status of
Errorwith the descriptionresponse succeed, inflating tracing error rates.How This Has Been Tested
Run in
golang:1.26-bookworm:go test ./gateway -run '^TestTraceMiddlewareProcessRequestSpanStatus$' -count=1go test -race ./gateway -run '^TestTraceMiddlewareProcessRequestSpanStatus$' -count=1go vet ./gatewayThe regression test was first run against the unmodified implementation and failed for direct and wrapped
ErrResponseSucceed; it passes after the fix.Screenshots (if appropriate)
N/A
Types of changes
Checklist