gogf / gf

GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
https://goframe.org
MIT License
11.79k stars 1.61k forks source link

add some config for server middleware trace for some special uri #2793

Open ltp217 opened 1 year ago

ltp217 commented 1 year ago

1. What version of Go and system type/arch are you using?

go 1.19, linux/amd64

2. What version of GoFrame are you using?

goframe version v2.2.2

3. Can this issue be re-produced with the latest release?

yes, can re-produced in the latest release, v2.5.0

4. What did you do?

if we want to disable some uri to export trace, like the healthcheck, or the /metrics uri, how should we do, in the 'internalMiddlewareServerTracing' middleware, every uri will export its trace info. can add some config for this to avoid some uri that didn't need the trace info.

5. What did you expect to see?

disable some uri to export trace info, maybe we can add some config for this.

github-actions[bot] commented 1 year ago

Hello @ltp217. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! 你好 @ltp217。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

gqcn commented 1 year ago

@ltp217 It might be better to remove the tracing middleware from default enabled middleware.

ltp217 commented 1 year ago

@gqcn it's greate influence when remove the default middleware, then just some special uri don't need the tracing info, like get metrics info or healthcheck. I think it's better to add some config for user to filter.