ricardo-ch / go-tracing Goto Github PK
View Code? Open in Web Editor NEWEasy to use tracing with zipkin or jaeger tracing in golang
License: MIT License
Easy to use tracing with zipkin or jaeger tracing in golang
License: MIT License
add tool to handle vendors in this repository
be careful about bug with thrift and opentracing (latest version of both will fail)
Your basic example is not working (the others maybe too)
if you do
docker run -d -p 9411:9411 openzipkin/zipkin
go run examples/basic/main.go
you will see no trace on your zipkin traces page.
It is due to the fact that you use
tracing.SetGlobalTracer(appName, "http://localhost:9411/")
instead of (removing the last /)
tracing.SetGlobalTracer(appName, "http://localhost:9411")
So when you create the collector
url := zipkinURL + "/api/v1/spans"
you have //.
There are 2 ways to fix it :
Or remove the / on the example (and maybe others examples)
Or fix the createCollector using maybe a path.join with a url.
OS : Ubuntu 18.04 LTS
This causes traces to fail with the following error:
{
"Accept":"application/json, application/json, application/*+json, application/*+json",
"Connection":"keep-alive","Uber-Trace-Id":"32b656ada59bca7d%3A32b656ada59bca7d%3A0%3A1",
"User-Agent":"Java/1.8.0_181",
"component":"users",
"err":"String does not match tracer state format"
}
The codahale/hdrhistogram repo has been transferred under the github HdrHstogram umbrella with the help from the original author in Sept 2020 (new repo url https://github.com/HdrHistogram/hdrhistogram-go). The main reasons are to group all implementations under the same roof and to provide more active contribution from the community as the original repository was archived several years ago.
The dependency URL should be modified to point to the new repository URL. The tag "v0.9.0" was applied at the point of transfer and will reflect the exact code that was frozen in the original repository.
If you are using Go modules, you can update to the exact point of transfer using the @v0.9.0 tag in your go get command.
go mod edit -replace github.com/codahale/hdrhistogram=github.com/HdrHistogram/[email protected]
From the point of transfer, up until now (mon 16 aug 2021), we've released 3 versions that aim support the standard HdrHistogram serialization/exposition formats, and deeply improve READ performance.
We recommend to update to the latest version.
Hi,I’m using go-tracing and it is nice to use. And I also have a question that how to set http status code tag in one span?It seems tracer can only set tag in http handler.
func handler(w http.ResponseWriter, r *http.Request) {
var tag map[string]interface{}
tag = make(map[string]interface{})
tag["http.url"] = r.URL.Path
tag["http.status_code"] = ?
span, ctx := tracing.CreateSpanFromClientContext(r, "hello-handler", &tag)
defer span.Finish()
nestedFunc(ctx)
log.Print("Hello world received a request.")
target := os.Getenv("TARGET")
if target == "" {
target = "golang"
}
fmt.Fprintf(w, "Hello %s!\n", target)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.