-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(otelgin): enhance gin error tracking with span recording #6346
base: main
Are you sure you want to change the base?
Conversation
Could you test this change? Also, I wonder if we need to keep the |
Side note that otelgin has no owner, so it may be removed soon. |
Okay, will this package still accept new PRs at present? |
It does. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6346 +/- ##
=====================================
Coverage 66.9% 66.9%
=====================================
Files 193 193
Lines 15652 15653 +1
=====================================
+ Hits 10479 10480 +1
Misses 4882 4882
Partials 291 291
|
I think I can give it a try. If I come to maintain it, what do I need to do? |
That's documented in the issue, as well as in https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CONTRIBUTING.md#code-owners. |
Co-authored-by: Damien Mathieu <[email protected]>
It's done. |
I spent some time reading through the requirements. I understand that I may still need to make some contributions before applying. If so, I need some time. |
link: #5252 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to look good 😸
instrumentation/github.com/gin-gonic/gin/otelgin/test/gintrace_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nit comments. Can you please address them before we merge?
@@ -13,6 +13,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||
- Added support for providing `endpoint`, `pollingIntervalMs` and `initialSamplingRate` using environment variable `OTEL_TRACES_SAMPLER_ARG` in `go.opentelemetry.io/contrib/samples/jaegerremote`. (#6310) | |||
- Added support exporting logs via OTLP over gRPC in `go.opentelemetry.io/contrib/config`. (#6340) | |||
|
|||
### Changed | |||
|
|||
- Record an error instead of setting the `gin.errors` attribute in `go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`. (#6346) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Record an error instead of setting the `gin.errors` attribute in `go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`. (#6346) | |
- Record errors instead of setting the `gin.errors` attribute in `go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`. (#6346) |
"go.opentelemetry.io/otel" | ||
"go.opentelemetry.io/otel/attribute" | ||
"go.opentelemetry.io/otel/codes" | ||
"go.opentelemetry.io/otel/propagation" | ||
semconv "go.opentelemetry.io/otel/semconv/v1.20.0" | ||
oteltrace "go.opentelemetry.io/otel/trace" | ||
|
||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this import rearrange change? We are grouping go.openteletry.io
. See
opentelemetry-go-contrib/.golangci.yml
Lines 108 to 109 in 96b1ed1
goimports: | |
local-prefixes: go.opentelemetry.io |
oteltrace "go.opentelemetry.io/otel/trace" | ||
|
||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this import rearrange change? We are grouping go.openteletry.io
. See
opentelemetry-go-contrib/.golangci.yml
Lines 108 to 109 in 96b1ed1
goimports: | |
local-prefixes: go.opentelemetry.io |
@@ -120,7 +122,17 @@ func TestError(t *testing.T) { | |||
attr := span.Attributes() | |||
assert.Contains(t, attr, attribute.String("net.host.name", "foobar")) | |||
assert.Contains(t, attr, attribute.Int("http.status_code", http.StatusInternalServerError)) | |||
assert.Contains(t, attr, attribute.String("gin.errors", "Error #01: oh no\n")) | |||
|
|||
// verify the error event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// verify the error event | |
// verify the error events |
No description provided.