OpenCensus instrumentation for Echo framework
The Echo middlleware provide OpenCensus instrumentations. It provide tracing and metrics features as same as ochttp
.
Heavily inspired ochttp
official plugin. Many parts of ocecho
has been copied from ochttp
.
Thanks for authors of ochttp
.
Requires Go 1.12 or later.
go get github.com/HatsuneMiku3939/ocecho
// ocecho Middleware
e.Use(ocecho.OpenCensusMiddleware(
ocecho.OpenCensusConfig{
Skipper: middleware.DefaultSkipper,
TraceOptions: ocecho.TraceOptions{
IsPublicEndpoint: true,
Propagation: &b3.HTTPFormat{},
StartOptions: trace.StartOptions{},
},
},
))
// Register server views
if err := view.Register(ocecho.DefaultServerViews...); err != nil {
log.Fatalf("Error creating metric views: %v", err)
}
You can found whole example in examples
.
- 0.3.2
- Add default Propagation option
- 0.3.1
- fix nill reference
- 0.3.0
Broke v0.2.0 compatibility
- Add Skipper option
- Update echo.v4
- 0.2.0
- Add IsPublicEndpoint option
- Fix Span name as same as
ochttp
- 0.1.1
- Fix RequestSize, ResponseSize metric bug
- 0.1.0
- Initial release
- Add unittest
Distributed under the Apache license. See LICENSE
for more information.
https://github.com/HatsuneMiku3939/
- Fork it (https://github.com/HatsuneMiku3939/ocecho/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request