GithubHelp home page GithubHelp logo

go-gin's People

Contributors

austinlparker avatar dependabot[bot] avatar rafaeleyng avatar stuart-mclaren avatar stuart-mclaren-hpe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-gin's Issues

Not possible to set the span operation name to the matched route

We would like to be able to set the span operation name to the matched gin route, however currently this is difficult. For example, if there is a route /user/:name, and a request is made to /user/foo, we would like to set the span name to the former.

The default span operation name is HTTP + method, e.g. HTTP GET. It's possible to override this default using the OperationNameFunc option, which gives access to the http.Request object, however I don't think that can be used to get the matched route (it's obviously possible to get the path, but that could contain path parameters, which we want to avoid).

As a side note, the gorilla/mux Opentracing middleware implementation defaults to the matched route as the operation name, see https://github.com/opentracing-contrib/go-gorilla/blob/3ee496ae11d5bebfd34703cee4efa29e0439a33d/gorilla/server.go#L35, which I think makes more sense than just the HTTP method used.

Should the version tags follow semantic versioning?

Looks like the tags are missing v prefix

As per go module doc

Every required module in a go.mod has a semantic version, the minimum version of that dependency to use to build the module.

A semantic version has the form vMAJOR.MINOR.PATCH.

Because of this go module puts an alias v0.0.0 and then hash of the commit of each tag

e.g.

$ go get -u github.com/opentracing-contrib/[email protected]
go: github.com/opentracing-contrib/go-gin 1.0.0 => v0.0.0-20190301172248-2e18f8b9c7d4

This also could confuse some folks who aren't familiar with go versioning and could result in 404 if prefix v is specified in go get

$ go get -u github.com/opentracing-contrib/[email protected]
go get github.com/opentracing-contrib/[email protected]: github.com/opentracing-contrib/[email protected]: invalid version: unknown revision v2.0.0

Support go modules and tag the project

Currently this project does not use go modules. Also, there is there are no tags to reference it.

We still can use it in projects using go modules by referencing by the commit hash, which is not ideal.

I could add a MR using go modules, but to tag I would need permission.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.