Discover Packages
github.com/kitabisa/perkakas/metrics/tracing
package
module
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Apr 4, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Open Tracing Context
Wrapping Service Dependencies with opentracing
Wraping Handler
This middleware wraps handler with opentracing context along with any identified request_id, path params, and query params.
handlerTracing := middleware.NewHandlerTracing()
r := chi.NewRouter()
r.Use(handlerTracing)
// put your routings below
Plase read middleware readme.md to know more about handler tracing middleware usage example.
Wraping go-redis
redisClient := redis.WrapRedisClient(ctx, redisClient)
Expand ▾
Collapse ▴
Documentation
¶
FunctionName get function name programmatically. It will return function name complete from the package and method
receiver name.
This function should called when you start span.
Do this:
span, ctx := opentracing.StartSpanFromContext(ctx, FunctionName())
Instead of:
span, ctx := opentracing.StartSpanFromContext(ctx, "Service.Brand.Create")
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.