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:
@@ -24,7 +24,6 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
@@ -64,11 +63,7 @@ func Run(logger *zap.Logger) {
|
||||
}
|
||||
}
|
||||
|
||||
openTracingEnabled, err := strconv.ParseBool(os.Getenv("OPENTRACING_ENABLED"))
|
||||
if err != nil {
|
||||
logger.Fatal("error parsing OPENTRACING_ENABLED", zap.Error(err))
|
||||
}
|
||||
|
||||
openTracingEnabled := tracing.TracingEnabled(logger)
|
||||
if openTracingEnabled {
|
||||
go func() {
|
||||
if err := tracing.RegisterTraceExporter(logger, *collectorEndpoint, "Fission-Fetcher"); err != nil {
|
||||
|
||||
@@ -225,11 +225,7 @@ Options:
|
||||
logger.Fatal("Could not parse command line arguments", zap.Error(err))
|
||||
}
|
||||
|
||||
openTracingEnabled, err := strconv.ParseBool(os.Getenv("OPENTRACING_ENABLED"))
|
||||
if err != nil {
|
||||
logger.Fatal("error parsing OPENTRACING_ENABLED", zap.Error(err))
|
||||
}
|
||||
|
||||
openTracingEnabled := tracing.TracingEnabled(logger)
|
||||
if openTracingEnabled {
|
||||
err = tracing.RegisterTraceExporter(logger, os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"), getServiceName(arguments))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user