Skip to content
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

contrib/gin-gonic/gin: support globalconfig.ServiceName() #767

Closed
marcind opened this issue Oct 24, 2020 · 1 comment · Fixed by #776
Closed

contrib/gin-gonic/gin: support globalconfig.ServiceName() #767

marcind opened this issue Oct 24, 2020 · 1 comment · Fixed by #776
Labels
apm:ecosystem contrib/* related feature requests or bugs proposal more in depth change that requires full team approval

Comments

@marcind
Copy link
Contributor

marcind commented Oct 24, 2020

Right now the gin trace middleware requires passing in a service name and it does not reference globalconfig.ServiceName(). Consider adding support for using the value of globalconfig.ServiceName() if the serviceName value passed into the middleware factory function is "". This will allow callers to opt into using the global service name without requiring a new overload to the middleware factory.

I can send a PR if this is something worth considering.

Also, consider changing the middleware factory signature and behavior to match that of other server tracer wrappers for a potential v2.

@gbbr gbbr changed the title Support globalconfig.ServiceName() in contrib/gin-gonic/gin contrib/gin-gonic/gin: support globalconfig.ServiceName() Oct 26, 2020
@gbbr gbbr added apm:ecosystem contrib/* related feature requests or bugs proposal more in depth change that requires full team approval labels Oct 26, 2020
@gbbr
Copy link
Contributor

gbbr commented Oct 26, 2020

I'd be happy if you were to open a PR for this. And yes, I agree with you that the signature of Middleware could be better.

marcind added a commit to marcind/dd-trace-go that referenced this issue Nov 17, 2020
This change adds support for `globalconfig.ServiceName()` to the gin
trace middleware. Because this middleware does not follow the same pattern
as other http frameworks and requires a service parameter to be passed in
we use the empty string value as an indicator that the default service
name should be used.

Fixes DataDog#767
knusbaum pushed a commit that referenced this issue Dec 10, 2020
This change adds support for `globalconfig.ServiceName()` to the gin
trace middleware. Because this middleware does not follow the same pattern
as other http frameworks and requires a service parameter to be passed in
we use the empty string value as an indicator that the default service
name should be used.

Fixes #767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs proposal more in depth change that requires full team approval
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants