You've already forked opentelemetry-go
							
							
				mirror of
				https://github.com/open-telemetry/opentelemetry-go.git
				synced 2025-10-31 00:07:40 +02:00 
			
		
		
		
	set othttp span status from HTTP status code (#832)
* set othttp span status from HTTP status code * set othttp span status from HTTP status code * set othttp span status from HTTP status code * remove the cast to int of statusCode Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
		| @@ -120,6 +120,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||||
| 	h.handler.ServeHTTP(rww, r.WithContext(ctx)) | ||||
|  | ||||
| 	setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err) | ||||
| 	span.SetStatus(standard.SpanStatusFromHTTPStatusCode(rww.statusCode)) | ||||
| } | ||||
|  | ||||
| func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user