-
Notifications
You must be signed in to change notification settings - Fork 119
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
OtelFiber: Add Next config setting #633
Conversation
Tests and readme adjustments are missing |
Why not using the skip middleware or a next function like in all other middlewares |
Thanks for looking into that. |
Where are the other config functions documented ? |
@ReneWerner87 just wanted to ask if this feature is relevant, otherwise I can close the PR. |
Sorry i lost the focus on this, will check it in next days and then let you know that the decision is |
first thank you for the effort however, it would be better if we follow the lead of all other middlewares and add a config setting for a check method "Next: func(c *fiber.Ctx) bool" We have this in all other middlewares and the users should be familiar with it. this would also give us more flexibility, because what if you don't want to use a url, but a parameter, cookie or header to skip this functionality. i know in the 2 other contrib middlewares(Fiberzap, otelfiber) a skipurl config property was also added So that this concept is found in all middlewares and the consumers see a red trail |
@ReneWerner87 Thanks for looking into that. Yes, with Next it would be much better, I'll try to adapt my PR to use that. |
otelfiber/config.go
Outdated
@@ -28,6 +29,12 @@ func (o optionFunc) apply(c *config) { | |||
o(c) | |||
} | |||
|
|||
func Next(f func(ctx *fiber.Ctx) bool) Option { |
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.
Not sure if to follow the pattern here should be WithNext, it's a bit different to the standard fiber middlewares where we have ConfigDefault
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.
name it withNext, its a shortcut function to work with the defaults
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.
LGTM
@emanuelef can you
https://github.com/gofiber/contrib/blob/main/otelfiber/README.md like the others we will use these readme's later in our https://docs.gofiber.io/ and there it is important to have all the information about this packet this should show up as an issue report in the repository itself or discord channel because only a well documented software can be well used |
I've added two new sections to the README, but I have some questions there. |
@emanuelef Totally agree, that could be done in a separate PR so this one can be merged. :-) |
Just an idea for #632
If this makes sense I can go on with this idea and start testing it.