Skip to content

Commit

Permalink
fix(otelgin): remove redundant error handling from HTML (#6373)
Browse files Browse the repository at this point in the history
Originating from
#5088 (comment)
  • Loading branch information
flc1125 authored Nov 27, 2024
1 parent dfd6b16 commit 251d2d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix broken AWS presigned URLs when using instrumentation in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`. (#5975)
- Fixed the value for configuring the OTLP exporter to use `grpc` instead of `grpc/protobuf` in `go.opentelemetry.io/contrib/config`. (#6338)
- Allow marshaling types in `go.opentelemetry.io/contrib/config`. (#6347)
- Removed the redundant handling of panic from the `HTML` function in `go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`. (#6373)

<!-- Released section -->
<!-- Don't change this section unless doing release -->
Expand Down
11 changes: 1 addition & 10 deletions instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ func HTML(c *gin.Context, code int, name string, obj interface{}) {
}()
opt := oteltrace.WithAttributes(attribute.String("go.template", name))
_, span := tracer.Start(savedContext, "gin.renderer.html", opt)
defer func() {
if r := recover(); r != nil {
err := fmt.Errorf("error rendering template:%s: %s", name, r)
span.RecordError(err)
span.SetStatus(codes.Error, "template failure")
span.End()
panic(r)
}
span.End()
}()
defer span.End()
c.HTML(code, name, obj)
}

0 comments on commit 251d2d4

Please sign in to comment.