feature: Capture important events with span in fission and add trace id in logs (#2180)
* Capture important open telemetry events with span in fission * Add context to missing HTTP calls * Add Trace ID in logs * capture trace id in the proxy handler function * Always registry tracer to get traceID Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -10,6 +10,17 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func TracingEnabled(logger *zap.Logger) bool {
|
||||
openTracingEnabled, err := strconv.ParseBool(os.Getenv("OPENTRACING_ENABLED"))
|
||||
if err != nil {
|
||||
if logger != nil {
|
||||
logger.Error("Error parsing OpenTracing enabled flag", zap.Error(err))
|
||||
}
|
||||
return false
|
||||
}
|
||||
return openTracingEnabled
|
||||
}
|
||||
|
||||
func RegisterTraceExporter(logger *zap.Logger, collectorEndpoint, serviceName string) error {
|
||||
if len(collectorEndpoint) == 0 {
|
||||
logger.Info("skipping trace exporter registration")
|
||||
|
||||
Reference in New Issue
Block a user