-
Notifications
You must be signed in to change notification settings - Fork 585
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
Add github.com/gofiber/fiber trace instrumentation #880
Conversation
Co-authored-by: ReneWerner87 <[email protected]>
instrumentation/github.com/gofiber/fiber/otelfiber/fiber_test.go
Outdated
Show resolved
Hide resolved
Could you please also add a line to |
instrumentation/github.com/gofiber/fiber/otelfiber/example/docker-compose.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Anthony Mirabella <[email protected]>
instrumentation/github.com/gofiber/fiber/otelfiber/fiber_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.
Was instrumentation/github.com/gofiber/fiber/README.md
not supposed to be removed?
Reference https://github.com/open-telemetry/opentelemetry-go-contrib/pull/880/files#r667995107
@pellared sorry I mistakenly removed the wrong |
oteltrace "go.opentelemetry.io/otel/trace" | ||
) | ||
|
||
var tracer = otel.Tracer("fiber-server") |
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.
@open-telemetry/go-approvers Would it be better to recommend:
- adding
sdktrace.WithResource(resource.NewWithAttributes(semconv.SchemaURL, semconv.ServiceNameKey.String("fiber-server"))),
tosdktrace.NewTracerProvider
call - creating the new span inside
getUser
usingoteltrace.SpanFromContext()
?
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.
A service name should definitely be provided in the resource given to the tracer provider initialization.
Co-authored-by: Robert Pająk <[email protected]>
) | ||
|
||
// Middleware returns fiber handler which will trace incoming requests. | ||
func Middleware(service string, opts ...Option) fiber.Handler { |
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.
@open-telemetry/go-approvers side question:
do we have an example of documentation that tells what attributes are being set for given instrumentation?
Co-authored-by: Robert Pająk <[email protected]>
@WLun001 You need to add the new modules to |
instrumentation/github.com/gofiber/fiber/otelfiber/example/go.mod
Outdated
Show resolved
Hide resolved
Co-authored-by: Robert Pająk <[email protected]>
@WLun001 Looks like you need to |
just ran |
Codecov Report
@@ Coverage Diff @@
## main #880 +/- ##
=======================================
+ Coverage 69.6% 79.4% +9.7%
=======================================
Files 77 64 -13
Lines 4955 2789 -2166
=======================================
- Hits 3451 2215 -1236
+ Misses 1365 441 -924
+ Partials 139 133 -6
|
oteltrace "go.opentelemetry.io/otel/trace" | ||
) | ||
|
||
var tracer = otel.Tracer("fiber-server") |
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.
A service name should definitely be provided in the resource given to the tracer provider initialization.
any updates on this PR? |
# Conflicts: # .github/dependabot.yml # CHANGELOG.md
Do you have any plan to add offical Fiber support? |
I do not think it will be merged. See: #1100 However, I hope that all the code reviews were helpful. |
Thanks for the contribution. According to our new instrumentation policy, we are no longer accepting new instrumentation to the project as we do not have the developer bandwidth to support it. If you are able, please consider maintaining this instrumentation in your own repository and listing it in the the OpenTelemetry Registry. |
@pellared thanks for the code review, very helpful |
close #843