added jaeger exporter for easier local testing
MODIFY
_hardcoded/tracing.go
_hardcoded/tracing.go
@@ -7,16 +7,14 @@ import (
"fmt"
"net/http"
"os"
- "strconv"
- "time"
"github.com/Clever/kayvee-go/v7/logger"
+ "go.opentelemetry.io/otel/exporters/jaeger"
+
"github.com/davecgh/go-spew/spew"
"go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
- "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
@@ -37,31 +35,33 @@ func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExpo
propagation.Baggage{}),
)
- samplingProbability := 0.01
- isLocal := os.Getenv("_IS_LOCAL") == "true"
- if isLocal {
- samplingProbability = 1.0
- } else if v := os.Getenv("TRACING_SAMPLING_PROBABILITY"); v != "" {
- samplingProbabilityFromEnv, err := strconv.ParseFloat(v, 64)
- if err != nil {
- return nil, nil, fmt.Errorf("could not parse '%s' to float", v)
- }
- samplingProbability = samplingProbabilityFromEnv
- }
- fmt.Println("isLocal:", isLocal)
-
- addr := fmt.Sprintf("%s:%d", defaultCollectorHost, defaultCollectorPort)
-
- // Every 15 seconds we'll try to connect to opentelemetry collector at
- // the default location of localhost:4317
- // When running in production this is a sidecar, and when running
- // locally this is a locally running opetelemetry-collector.
- otlpClient := otlptracegrpc.NewClient(
- otlptracegrpc.WithReconnectionPeriod(15*time.Second),
- otlptracegrpc.WithEndpoint(addr),
- otlptracegrpc.WithInsecure(),
- )
- spanExporter, err := otlptrace.New(ctx, otlpClient)
+ // samplingProbability := 0.01
+ // isLocal := os.Getenv("_IS_LOCAL") == "true"
+ // if isLocal {
+ // samplingProbability = 1.0
+ // } else if v := os.Getenv("TRACING_SAMPLING_PROBABILITY"); v != "" {
+ // samplingProbabilityFromEnv, err := strconv.ParseFloat(v, 64)
+ // if err != nil {
+ // return nil, nil, fmt.Errorf("could not parse '%s' to float", v)
+ // }
+ // samplingProbability = samplingProbabilityFromEnv
+ // }
+ // fmt.Println("isLocal:", isLocal)
+
+ // addr := fmt.Sprintf("%s:%d", defaultCollectorHost, defaultCollectorPort)
+
+ // // Every 15 seconds we'll try to connect to opentelemetry collector at
+ // // the default location of localhost:4317
+ // // When running in production this is a sidecar, and when running
+ // // locally this is a locally running opetelemetry-collector.
+ // otlpClient := otlptracegrpc.NewClient(
+ // otlptracegrpc.WithReconnectionPeriod(15*time.Second),
+ // otlptracegrpc.WithEndpoint(addr),
+ // otlptracegrpc.WithInsecure(),
+ // )
+ // spanExporter, err := otlptrace.New(ctx, otlpClient)
+ spanExporter, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint("http://localhost:14268/api/traces")))
+
fmt.Println("Exporter Created")
if err != nil {
return nil, nil, fmt.Errorf("error creating exporter: %v", err)
@@ -79,7 +79,7 @@ func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExpo
}
func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64, resource *resource.Resource) *sdktrace.TracerProvider {
- return sdktrace.NewTracerProvider(
+ tp := sdktrace.NewTracerProvider(
// We use the default ID generator. In order for sampling to work (at least with this sampler)
// the ID generator must generate trace IDs uniformly at random from the entire space of uint64.
// For example, the default x-ray ID generator does not do this.
@@ -97,6 +97,10 @@ func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float
//Have to figure out how I'm going to generate this resource first.
sdktrace.WithResource(resource),
)
+ otel.SetTracerProvider(tp)
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
+
+ return tp
}
// SetupGlobalTraceProviderAndExporterForTest is meant to be used in unit testing,
@@ -118,6 +122,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler {
return func(h http.Handler) http.Handler {
return otlmux(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
// otelmux has extracted the span. now put it into the ctx-specific logger
+ var carrier propagation.HeaderCarrier = propagation.HeaderCarrier{}
+
+ // otelmux has extracted the span. now put it into the ctx-specific logger
+ ctx := otel.GetTextMapPropagator().Extract(r.Context(), carrier)
+ spew.Dump(r.Header)
+ testsc := trace.SpanFromContext(ctx).SpanContext()
+ spew.Dump(testsc)
+
s := trace.SpanFromContext(r.Context())
rid := r.Header.Get("X-Request-ID")
if rid != "" {
@@ -125,6 +137,11 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler {
} else {
s.SetAttributes(attribute.String("X-Request-ID", s.SpanContext().TraceID().String()))
}
+
+ testctx := trace.ContextWithSpanContext(ctx, s.SpanContext())
+ r2 := r.Clone(testctx)
+ spew.Dump(r2.Header)
+
if sc := s.SpanContext(); sc.HasTraceID() {
spanID, traceID := sc.SpanID().String(), sc.TraceID().String()
fmt.Println("span/trace: ", spanID, " ", traceID)

MODIFY
clients/go/gengo.go
clients/go/gengo.go
@@ -212,7 +212,8 @@ func newResource() *resource.Resource {
}
func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64) *sdktrace.TracerProvider {
- return sdktrace.NewTracerProvider(
+
+ tp:= sdktrace.NewTracerProvider(
// We use the default ID generator. In order for sampling to work (at least with this sampler)
// the ID generator must generate trace IDs uniformly at random from the entire space of uint64.
// For example, the default x-ray ID generator does not do this.
@@ -227,7 +228,11 @@ func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float
sdktrace.WithSyncer(exporter),
//sdktrace.WithBatcher(exporter),
sdktrace.WithResource(newResource()),
+
)
+ otel.SetTracerProvider(tp)
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
+ return tp
}
func doNothing(baseTransport http.RoundTripper, spanNameCtxValue interface{}, tp sdktrace.TracerProvider) http.RoundTripper {
@@ -324,7 +329,7 @@ func NewFromDiscovery() (*WagClient, error) {
return nil, err
}
}
- return New(context.Backgroung(), url), nil
+ return New(context.Background(), url), nil
}
// SetRetryPolicy sets a the given retry policy for all requests.

MODIFY
hardcoded/hardcoded.go
hardcoded/hardcoded.go
// sources:
// ../_hardcoded/doer.go (10.35kB)
// ../_hardcoded/middleware.go (1.685kB)
-// ../_hardcoded/tracing.go (6.391kB)
+// ../_hardcoded/tracing.go (6.985kB)
package hardcoded
@@ -111,7 +111,7 @@ func _hardcodedMiddlewareGo() (*asset, error) {
return a, nil
}
-var __hardcodedTracingGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x58\xdd\x4f\xe4\x46\x12\x7f\xb6\xff\x8a\x8a\xa5\xcd\xda\x2b\x63\x43\xb2\xd9\x44\x44\x3c\xb0\xc0\xee\x8e\x0e\xc8\x08\x88\x72\xa7\xd3\x09\x35\x76\x8d\xdd\x5a\xbb\xdb\xd7\xdd\x9e\x0f\xad\xf8\xdf\x4f\x55\xfe\x98\x31\x0c\x5c\x12\x1e\xd0\xb8\xbb\xea\xd7\x55\xd5\xf5\xd9\x8d\xc8\xbe\x8a\x02\xc1\xa2\x59\xa2\x71\x46\x64\x52\x15\xbe\x2f\xeb\x46\x1b\x07\xa1\xef\x05\x99\x56\x0e\xd7\x2e\xf0\xbd\x00\x55\xa6\x73\xa9\x8a\xf4\x41\x2a\x61\x36\x93\xa5\x12\xd7\xf4\xbd\xa8\x99\x52\xa1\x4b\x4b\xe7\x1a\xfa\xad\x2d\xfd\xb7\xce\x64\x5a\x2d\xe9\xa7\x93\x35\x06\xbe\xef\x05\x85\x74\x65\xfb\x90\x64\xba\x4e\xcf\x2a\x5c\xa2\x49\xbf\x8a\xcd\x12\xf1\xa0\xd0\xe9\xf2\xe7\xb4\xd2\x45\x81\x26\x98\x12\xe6\x62\x89\x59\x51\xa6\x85\x3e\xb0\x0d\xae\x52\xfa\xc7\x24\x3a\xd1\x0d\x2a\x87\x15\xd6\xe8\xcc\x26\x91\x3a\x25\xd1\x8d\x7c\x48\xa5\xb2\xce\xb4\x35\x2a\x27\x9c\xd4\x2a\xdd\x81\x2b\xb4\x91\x55\x25\xd2\xba\x5d\xa7\xda\x61\x55\xb7\xeb\x97\xd0\x68\xfb\xb5\xbd\x54\x38\x3a\xad\x75\xf8\x2a\x15\xae\xc9\xb4\x68\x6c\xaa\x5d\xd5\xf0\x3f\x32\xfb\xdf\x63\xda\xfe\x2a\x4c\x93\xbd\x0a\xd1\x18\xdd\x88\x82\x0d\xf0\x2a\x9d\xcd\xbf\xa6\x06\xad\x6e\x0d\xcb\x64\xf3\xaf\x8c\x0f\xaf\x73\xfc\x7f\x15\x46\xaa\xee\xbf\x43\x4b\x9e\x62\xb1\x26\xb7\x78\x0d\xbd\xa3\x48\x97\x47\xc9\xd1\x61\x72\xf8\xea\x19\xbd\x14\x91\xef\x2f\x85\x81\x1c\x17\xa2\xad\xdc\x99\xae\x2a\xcc\x9c\x36\x5f\xb4\x75\x60\x9d\x91\xaa\x80\x13\x08\x2a\x9d\x89\xaa\xd4\x24\xc6\x3e\xea\x39\x05\x40\x2b\x95\x3b\xfa\x00\x27\xf0\xfe\xc7\xa3\x9f\x7d\x3f\x4d\x61\x30\xa3\x36\xe0\x34\xb4\x16\x13\xe6\xde\x59\xde\x31\x74\x72\x87\x6b\x77\x25\x9a\xf9\x76\xf7\x64\xba\x4f\x02\x9f\x75\x11\xf6\xed\x11\xd2\x14\x58\x85\x46\x18\x54\x0e\x4a\x14\x39\x1a\x7f\xd1\xaa\x0c\x6e\xd1\xb5\xcd\xe7\x4a\x3f\x88\x8a\x99\xe6\x46\x2f\x65\x8e\xe6\x54\xe5\x17\xbd\x73\x84\x99\x5b\x43\x1f\xae\x49\x0f\x1a\x41\x38\xdc\x60\x72\xdb\x08\x35\xd0\xc6\xf0\x6e\x5c\x67\x3c\x33\x00\xc6\x80\xc6\x68\x13\xc1\x37\xdf\x23\xa3\x26\xb7\xe8\x9e\xa9\x11\xfa\x9e\xb7\xab\xc7\x35\xae\xce\x74\xdd\x68\x2b\x1d\xee\x25\xf6\x5e\xd6\x3a\x7e\xba\xfd\x51\x14\x85\x28\xf0\xdb\x63\x14\xfb\x5e\xe4\xfb\x9e\x15\x75\x53\x49\x55\xcc\x8d\x7e\x10\x0f\xb2\x92\x6e\x03\xc7\x27\x70\x98\x1c\x1e\xf9\x9e\xb4\x97\x74\x91\xb4\xa0\x6d\xf2\x19\x1d\xaa\x65\x18\xdc\xcf\x6e\xef\x2f\x7f\x3b\x3b\xbd\x0c\x22\x38\x39\x81\xc0\x99\x96\xdc\x53\x2e\x60\xa0\xff\xe6\x7b\x7b\x81\x4f\xe0\x28\x39\xf4\xbd\x47\xc0\xca\x22\xc8\x05\x2c\x9f\x40\xdf\xdd\x9c\x9e\xcd\xae\x3f\xdf\xdf\x9e\x5e\xcd\x2f\xe9\xc7\xfc\xe6\xb7\x8f\xa7\x1f\x67\x97\xb3\xbb\x7f\x05\xd1\xaf\xb0\x84\xef\x4e\x20\x08\x5e\x3a\xe0\x93\xd1\xf5\x85\x5a\xb2\x99\x09\xb9\x4f\x8c\xc9\x5c\x18\x8b\x9f\x2a\x2d\x5c\xb8\x8c\xe1\xc3\xfb\xc8\xf7\x48\x5c\xa2\xfa\xee\x04\x94\xec\x24\xf6\x0c\xba\xd6\x28\xfa\x8e\xbb\x7f\x8b\xda\x25\x17\x74\x63\x8b\x30\xc8\x74\x5b\xe5\xa0\xb4\x83\x86\xd0\xe0\xed\x1b\xfb\x96\xdc\x74\x41\xb0\x41\x0c\x4b\x02\x7d\x7c\x51\xf1\x97\xa5\xf5\x89\x8b\x4e\x9a\x1b\xa9\x5c\xa5\xc2\xa0\x37\xe3\x71\x10\x0f\x16\xa5\x9b\x12\x79\xce\x4a\x11\xe9\x6d\x43\xb4\x8b\x30\x78\x63\x8f\xdf\xe4\x41\xbc\x37\x1e\x9f\xaf\x52\xdc\x11\x54\x9a\xc2\xc5\x12\xcd\x06\x8e\x7e\x02\x8b\x99\x56\xb9\x85\x15\xbe\xad\x2a\x70\x66\x43\x4a\x65\x5a\x29\xcc\x1c\xfd\x9c\x64\x03\xc8\x06\x28\x10\x8e\x71\x5c\x89\xc3\x31\x40\x51\x4f\x5e\x06\x7a\x01\x63\x06\x38\xe6\xf0\x26\xd2\x3f\x4a\x54\x60\x5a\xa5\x28\x49\x48\x45\xc1\x9a\xb7\x19\x33\xb8\x52\x5a\x90\x16\x04\x58\x99\x63\x26\x4c\x0c\x42\xe5\xb0\xda\xe1\x60\x08\x46\xad\x36\x3b\xf4\xc3\xca\x80\xab\x1b\x1c\xa5\x3d\x18\xa5\x4d\x28\xde\xaa\xe6\xac\x92\x14\xfb\xe4\x73\xbb\xb9\x9d\x43\x8c\xb7\x28\x9c\xa6\x5b\x7f\x48\x57\xde\x60\x6f\x0f\xa9\xd5\x1c\x8d\xd4\x79\x78\xf4\xd3\x3b\x2a\xb5\xc9\x2d\x5b\x8f\x82\x69\x0f\xdf\x85\xca\x1b\x2d\x95\x0b\xe9\xea\x5e\xa0\x99\x29\x8b\x59\x6b\x30\xec\x02\xd2\xb3\x93\x44\xd2\xfb\xf1\xc8\x46\x92\x52\x2a\x8a\x61\xab\x4e\xf4\xc4\x7b\x06\x6e\x38\x33\x28\x1c\xe6\x41\xe4\xef\x71\xf6\x57\x7d\x9d\xb3\x14\x64\xc4\x4f\x36\x1d\x2a\xe4\x31\xbc\x59\x06\x2c\x54\x44\x4e\xeb\x7b\xae\x21\xe9\x14\xae\xa6\x69\x2e\x9c\x2a\xb1\xc7\xf5\x63\x62\xba\xe9\x2b\x61\x18\x45\x3b\xe9\x70\x8a\xe4\x9a\xa7\xea\x75\x04\x30\x50\xec\x68\xe9\x7b\x5d\x57\x93\x50\x60\xf5\x29\x90\x8c\x15\x25\x33\xb5\xd0\xe7\x61\x60\x9d\x30\xa4\xd0\x01\xdb\xd2\x04\x31\xf4\x0c\x57\x64\x91\x80\x6e\x09\xad\x0d\x8e\xa1\xfb\xa3\x6f\xba\xb4\x60\x50\xe0\xc0\x08\x87\xc1\xf1\x5e\x85\x7c\xef\x31\xf2\x07\xab\x4e\xf5\x77\x0d\x9b\xd8\x7f\xf4\xbb\x72\xf3\xdc\x5e\x83\x81\xe1\x85\x7a\xb2\x2f\xa5\x70\xde\xf9\xf0\x3e\x86\xa1\xa1\x80\x77\xc3\xaf\x64\xb0\x6c\xf4\x62\x25\x22\x1f\x18\x84\x1d\x28\xae\x9f\xc9\xe5\x7b\x1c\xb7\x48\xb5\x78\x12\xe9\xb3\x73\x28\x50\xa1\xa1\x12\x94\xc0\x4c\x81\x36\x04\xba\xd0\x66\x94\x95\x72\xc7\x4a\x9b\xaf\x10\x0a\x07\x15\x0a\xeb\x60\x25\x5d\xd9\x85\x2e\x13\x21\xb9\xd1\x90\x43\x76\x11\xa1\x6e\xad\x1b\x3e\xb1\x2b\xdb\x30\x3b\xb7\xd0\x2a\xb9\xd0\xa6\xae\x36\x20\x1c\x18\xa1\x72\x5d\xc3\xc2\xe8\x9a\x11\x50\x39\x69\x90\x6c\x9f\x21\x65\x20\xea\x2f\x3e\xbc\x4f\xba\x23\x3e\x69\x03\xb8\xe6\x53\xe3\x89\x26\xeb\x03\x23\x36\xd3\xd3\x73\x8d\x96\x13\x7d\xae\x59\x5a\x82\x18\x8d\x44\x31\x7b\xdb\x49\xbf\xad\xfe\xa7\xd5\x4a\x6c\x6c\xb7\x1c\x46\x1c\xe9\x69\x0a\xaf\xf3\xcc\xb9\x0f\xf9\x28\x2c\xe6\xe1\xf4\x92\x66\xe7\x37\x94\x46\xfb\xad\xe7\x57\x1f\x8d\x27\xdc\x95\x68\x11\x6a\xb1\x96\x75\x5b\x5b\x10\x06\xc9\xea\x45\x2b\x4c\x0e\xa2\x10\xd4\x9b\x83\xd5\x35\xba\x92\x2e\xa4\xd0\xf4\x7f\x65\xb4\x2a\x38\xbb\x5a\x54\x34\x5e\x80\x00\xd7\xe5\xec\x5c\x38\x01\xad\xc2\x75\x83\x99\xc3\xbc\xda\x3c\x53\xbc\x11\xea\x52\xd6\xd2\xd9\x69\xe7\xd3\xad\x71\x0d\x3d\x1d\x1a\xf5\x33\xdd\x2a\xc7\x1b\xc7\x70\x74\x78\xc8\x9d\xc8\xc5\x12\x95\xdb\xdd\xa0\xbf\x61\xf3\x52\xaa\xaf\x4f\xf7\x86\xcd\xc7\x5e\xe3\x8f\xc2\x65\x25\x1a\x4a\xfd\xb5\x36\x08\xb8\x58\xc8\x8c\x92\x60\x0c\x76\x25\x5d\x56\x92\xfe\xd2\x81\x58\x50\x34\x51\x1f\xcc\x95\xe3\x89\x16\x1b\x95\xed\x04\x5d\x0f\x3d\x21\xe9\xcf\x79\x4a\xf3\x45\x2c\xd9\xc2\x0b\x59\xb4\x06\x41\xb7\x0e\x4a\xbd\x82\xd9\xdb\xba\x37\x2e\x59\x7f\x74\x5b\x72\xf4\x31\x38\x17\xd2\x58\xf7\xcc\x93\xc6\x14\x38\xd0\x75\x55\xe0\x91\xdb\xe1\x3f\xd1\x96\x7e\xd2\xe6\x0e\xad\x63\x7b\xa0\x50\x5c\xb0\x1f\x38\x5c\x73\xaa\xb0\xad\x92\x6e\xb0\x42\x4c\x90\x74\xed\xb5\xa4\xec\x6e\x39\x0a\x2c\x1d\x01\xe2\x41\x2f\x91\x83\x57\xb7\x8e\x0a\x30\x87\xcf\x0e\x6f\x02\x33\x07\x5d\xba\xb0\x20\x14\x48\x75\x50\x63\xad\xcd\x86\x30\xc7\xe4\xb5\xe8\x63\x4c\x72\x21\x1e\xec\x90\x73\x36\xb4\xc9\x9f\x6e\xb5\x7b\x9d\xc2\x08\xc2\x77\xe3\x38\x93\xcc\xd4\x15\x9f\xf8\xd7\x9a\xec\x51\xb6\xe3\x13\xd8\x62\x5d\xe3\xea\x29\x5c\x18\xbd\x5c\xcd\x70\x3c\xf2\x28\x39\xfc\x6b\x95\xab\x4f\xb1\xb8\xaf\x16\xa4\x29\x5c\xb5\xeb\x5b\x7e\x1c\xb8\x92\x79\x5e\xe1\x8a\x02\x78\x30\x73\xbd\x5d\x72\xa5\x70\x60\x4b\x6e\x40\x1f\x10\x84\x73\x22\x2b\x31\xa7\xcb\x16\xb0\x33\x65\xf7\x2f\x0d\x09\x41\xcf\x5c\x97\xc7\xdc\x8a\x93\x98\x2a\xec\x31\x70\xfd\xb3\xdd\x7d\x74\x0d\x96\xc8\xf3\xee\xbb\x1b\xef\x40\xaa\x85\x26\x58\xf2\x0d\x83\xff\x6d\xd1\xba\x03\xdb\x60\x26\x17\x32\x1b\x8a\x25\xa1\xdf\xc8\xa2\x74\xa0\xf4\x0a\x56\x08\x5a\x55\x1b\xb0\x6d\xc3\xcf\x1a\x44\x44\xd7\x4f\xe9\x5a\x2a\x06\xa2\x94\x2d\x5c\xa7\xc5\xb9\x70\x22\xd7\xdc\x52\x60\xe6\x06\xaf\xd8\x63\x87\x90\x74\x91\x19\x5e\x8b\x1a\xfb\xc1\x32\x02\x22\x0e\x4b\xe7\x9a\xe4\x8b\x50\x39\x15\x10\xd8\xfd\xea\xc6\xaa\x8a\x2c\xc1\x4d\x13\x3f\x39\x24\xfb\x31\xe3\x71\x9f\xe2\x70\x3b\x50\xd9\x90\xef\xf3\xf3\xbe\xc1\x2c\x8a\x9e\x36\x23\xa7\x39\x67\xd0\xad\xed\x77\xae\x2d\xd8\xde\x7f\x27\x37\xbc\x2e\xf9\x40\xdc\x69\x30\x51\xf3\x13\xf1\x33\x88\x59\x75\x7c\x37\x68\x1b\xad\x2c\xfe\x61\x24\xfb\x95\x81\x77\xfd\x3a\x5f\x5a\xd4\x0d\x34\x69\x3a\x68\x09\xa5\xb0\x80\x6b\xba\x65\x0a\x49\x8e\xfd\x46\xa8\x84\xef\xb0\x69\x1d\x25\x4d\xa9\xfa\x9b\xcf\xdc\xfa\xe9\xad\x13\x9a\x1d\xa3\x88\x93\xfe\x6e\x97\x65\x86\x99\x98\x23\xc2\xf3\x8c\xcc\x89\xd8\x24\x5f\x78\xcc\x26\x73\x86\xc1\x3f\x0f\x7a\xe9\x0e\x66\xe7\x01\x93\xc9\x05\x10\xe5\x76\xa6\xf3\x3c\x4b\xa1\x34\x16\x11\x1b\x8e\x0f\x3f\xc9\x2d\x3b\xc1\x13\x98\x98\x00\xba\x33\xfb\xa9\xf2\x6f\xc2\x58\xd6\x69\xd4\x62\xa8\xc4\x61\x34\x30\x44\xfd\x29\xbd\xdc\x36\xe3\x01\x73\xca\xf5\x2b\xd8\x2c\xf9\x22\xec\xc8\x3c\x48\xd3\x08\x35\x3b\x8f\x3b\xe3\xcd\xce\x99\x33\x63\xd6\xc9\x09\x31\xad\x3e\x3f\x98\x21\x26\x6e\xb7\x8d\xd8\x63\x20\xd9\x7b\xf8\x80\x3e\xfa\x33\xa2\xfe\x60\x5c\x25\xe7\x6d\xdd\x84\x36\xeb\x56\xd2\x94\xcb\x3c\xc5\x20\x8d\xc6\x48\x09\xa1\xc4\x75\x1f\x62\x96\x1f\x5e\xb8\x71\xa2\x08\x8e\xc1\x6a\x72\x00\x70\xa5\xb6\x48\x1f\x1c\xc4\x99\x36\x06\xab\x6e\x36\xa8\x74\x61\x39\x95\xf0\xb9\x96\x5b\x3e\xcb\x27\xc9\x05\x54\xa8\xc2\x41\x1e\x38\x39\x81\x1f\x7f\x80\xef\xbf\xe7\xd5\x4e\x64\x5e\x3c\xfa\x00\xdf\x80\x3c\x75\x32\x68\x76\x49\xe3\x98\x76\x1f\x36\x0e\x21\xfc\xf1\x87\x83\xac\x14\x86\x84\x8d\x62\xf8\xa5\x5f\x3d\xfa\xb0\x5d\xed\x1b\x45\x6e\x6d\x1a\xaa\x52\x79\x27\x88\xd7\x8b\xf0\xd1\xc6\x70\x4f\xb6\x2f\x71\x9d\x9c\x63\xa6\x73\xec\x4d\x3c\xb1\xd9\xbe\x29\x62\xd7\xbf\x93\xd3\x3c\x1f\xbe\x02\xe6\xbc\x97\x79\x10\x77\xbc\xde\x74\x3a\xa7\xd1\xbc\x7b\xd0\x4d\x3e\xca\xe2\x42\xe5\x52\xa8\xe4\x77\xb6\x6f\x38\x4a\xf5\xef\x5f\x8e\xff\xd3\x7b\xd7\xe0\x2a\x2f\x8b\xda\x1b\xee\xaf\x4b\x4a\x8c\x7f\x4f\xd0\x41\xa4\x41\xc6\xc7\x31\x0e\xca\x84\xd3\xf6\x97\xbb\xbb\x79\x68\x56\x31\x70\x43\xff\x18\xf1\x74\xd8\x55\xb8\x9d\x62\xb9\x6d\x20\xb6\x5d\x51\x8e\x36\x33\xf2\x81\x5b\x27\x6a\x97\x44\xd3\x54\xb2\x7b\x44\xe0\x3a\xf3\x3b\x35\x32\x3c\x55\xa0\x63\x77\x6b\x9b\xee\x96\xf9\x29\x90\x0b\xed\x38\x53\x6d\x8b\xf2\x9e\x49\x88\x02\x71\x29\x0c\x1d\xb0\x53\x51\x9e\x64\xf3\xb3\x61\xe0\x1d\xb8\xfa\xd1\x79\xf7\xed\x6b\xfe\xdb\xf9\x3d\xa5\xaf\x9d\xa4\x35\x60\x4e\x1f\xc9\x4e\xe7\xf3\xfb\xeb\xd3\xab\x0b\xc2\xd8\x3e\x78\xed\x50\xfc\x59\xa4\x09\x90\xef\x99\xde\x33\x46\x15\xaf\xd0\x14\x18\x72\xfd\xe8\x57\xce\xbb\xd9\x86\x9f\x14\xb6\xab\xd7\xb8\xa2\x52\xb7\x93\x14\x39\xa9\x77\x4f\xc0\xc9\x6d\x56\x62\x2d\x7e\xbf\xb9\x8c\x27\xab\xdb\x82\xf9\x0f\xdc\x0c\x19\xa9\x17\x93\xe1\xfb\x67\x8b\xbe\x76\x19\xff\xd1\xff\x5f\x00\x00\x00\xff\xff\x53\x18\x05\x26\xf7\x18\x00\x00")
+var __hardcodedTracingGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x59\x6d\x6f\xe3\x36\xf2\x7f\x2d\x7d\x8a\xa9\x80\xed\x4a\x0b\x45\x4a\xb6\xdb\x6d\x91\xc2\x2f\xf2\xb4\xbb\xc6\x3f\x49\x8d\x24\x45\xff\x87\xc3\x21\x60\xa4\xb1\x44\xac\x44\xea\x48\xca\x0f\x58\xe4\xbb\x1f\x86\xa2\x64\xcb\xb1\x73\xdb\xe2\xf2\xc2\xb0\xc9\xe1\x8f\xf3\xc0\xf9\xcd\x90\x69\x58\xf6\x95\x15\x08\x1a\xd5\x02\x95\x51\x2c\xe3\xa2\xf0\x7d\x5e\x37\x52\x19\x08\x7d\x2f\xc8\xa4\x30\xb8\x32\x81\xef\x05\x28\x32\x99\x73\x51\xa4\x4f\x5c\x30\xb5\x1e\x0d\x95\xb8\xa2\xdf\xf3\xda\x4a\x0a\x34\x69\x69\x4c\x43\xdf\xa5\xa6\x4f\x6d\x54\x26\xc5\x82\xbe\x1a\x5e\x63\xe0\xfb\x5e\x50\x70\x53\xb6\x4f\x49\x26\xeb\xf4\xa2\xc2\x05\xaa\xf4\x2b\x5b\x2f\x10\x8f\x0a\x99\x2e\x7e\x49\x2b\x59\x14\xa8\x82\xb1\x60\xce\x16\x98\x15\x65\x5a\xc8\x23\xdd\xe0\x32\xa5\x0f\x2b\x22\x13\xd9\xa0\x30\x58\x61\x8d\x46\xad\x13\x2e\x53\x52\x5d\xf1\xa7\x94\x0b\x6d\x54\x5b\xa3\x30\xcc\x70\x29\xd2\x2d\xb8\x42\x2a\x5e\x55\x2c\xad\xdb\x55\x2a\x0d\x56\x75\xbb\x3a\x84\x46\xd3\xaf\xcd\xa5\xcc\xd0\x6e\xad\xc1\x57\xa5\x70\x45\xae\x45\xa5\x53\x69\xaa\xc6\x7e\x90\xdb\xff\xde\xa2\xcd\xb7\x42\x35\xd9\xab\x10\x8d\x92\x0d\x2b\xac\x03\x5e\x95\xd3\xf9\xd7\x54\xa1\x96\xad\xb2\x3a\xe9\xfc\xab\xc5\x87\xd7\x57\xfc\x77\x13\x06\xa9\xee\xd3\xa0\xa6\x93\xa2\xb1\xa6\x63\xf1\x1a\x7a\x27\x91\x2e\x4e\x92\x93\xe3\xe4\xf8\xd5\x3d\x9c\x16\x91\xef\x2f\x98\x82\x1c\xe7\xac\xad\xcc\x85\xac\x2a\xcc\x8c\x54\x5f\xa4\x36\xa0\x8d\xe2\xa2\x80\x09\x04\x95\xcc\x58\x55\x4a\x52\x63\x9f\xf4\x8c\x12\xa0\xe5\xc2\x9c\x7c\x84\x09\x7c\xf8\xe9\xe4\x17\xdf\x4f\x53\xe8\xdd\x28\x15\x18\x09\xad\xc6\xc4\xae\xde\x1a\xde\x72\x74\xf2\x80\x2b\x73\xc3\x9a\xd9\x66\x76\x32\x9e\x27\x85\x2f\xba\x0c\xfb\xf6\x0c\x69\x0a\xd6\x84\x86\x29\x14\x06\x4a\x64\x39\x2a\x7f\xde\x8a\x0c\xee\xd1\xb4\xcd\xe7\x4a\x3e\xb1\xca\x2e\x9a\x29\xb9\xe0\x39\xaa\x33\x91\x5f\xb9\xc3\x11\x66\x66\x05\x2e\x5d\x13\x07\x1a\x41\xd8\x47\x30\xb9\x6f\x98\xe8\x65\x63\x78\x37\x8c\x5b\x3c\xd5\x03\xc6\x80\x4a\x49\x15\xc1\x37\xdf\x23\xa7\x26\xf7\x68\x5e\x98\x11\xfa\x9e\xb7\x6d\xc7\x2d\x2e\x2f\x64\xdd\x48\xcd\x0d\xee\x15\xf6\x0e\x5b\x1d\xef\x4e\x9f\xb3\xa2\x60\x05\x7e\x7b\x8e\x62\xdf\x8b\x7c\xdf\xd3\xac\x6e\x2a\x2e\x8a\x99\x92\x4f\xec\x89\x57\xdc\xac\xe1\x74\x02\xc7\xc9\xf1\x89\xef\x71\x7d\x4d\x81\xa4\x01\xa9\x93\xcf\x68\x50\x2c\xc2\xe0\x71\x7a\xff\x78\xfd\xfb\xc5\xd9\x75\x10\xc1\x64\x02\x81\x51\x2d\x1d\x4f\x3e\x87\x5e\xfe\x9b\xef\xed\x05\x9e\xc0\x49\x72\xec\x7b\xcf\x80\x95\x46\xe0\x73\x58\xec\x40\x3f\xdc\x9d\x5d\x4c\x6f\x3f\x3f\xde\x9f\xdd\xcc\xae\xe9\xcb\xec\xee\xf7\xf3\xb3\xf3\xe9\xf5\xf4\xe1\x1f\x41\xf4\x1b\x2c\xe0\x87\x09\x04\xc1\xa1\x0d\x3e\x29\x59\x5f\x89\x85\x75\x33\x21\x3b\x62\x4c\x66\x4c\x69\xfc\x54\x49\x66\xc2\x45\x0c\x1f\x3f\x44\xbe\x47\xea\x92\xd4\x0f\x13\x10\xbc\xd3\xd8\x53\x68\x5a\x25\xe8\x77\xdc\x7d\xcc\x6b\x93\x5c\x51\xc4\xe6\x61\x90\xc9\xb6\xca\x41\x48\x03\x0d\xa1\xc1\xdb\x37\xfa\x2d\x1d\xd3\x39\xc1\x06\x31\x2c\x08\xf4\xf9\xa0\xe1\x87\xb5\xf5\x69\x15\xed\x34\x53\x5c\x98\x4a\x84\x81\x73\xe3\x69\x10\xf7\x1e\xa5\x48\xb1\x3c\xb7\x46\x91\xe8\x7d\x43\xb2\xf3\x30\x78\xa3\x4f\xdf\xe4\x41\xbc\x37\x1f\x5f\x8e\x52\xde\x11\x54\x9a\xc2\xd5\x02\xd5\x1a\x4e\x7e\x06\x8d\x99\x14\xb9\x86\x25\xbe\xad\x2a\x30\x6a\x4d\x46\x65\x52\x08\xcc\x0c\x7d\x1d\xb1\x01\x64\x3d\x14\x30\x63\x71\x4c\x89\xfd\x36\x40\x59\x4f\xa7\x0c\xe4\x1c\x06\x06\x38\xb5\xe9\x4d\xa2\x7f\x96\x28\x40\xb5\x42\x10\x49\x70\x41\xc9\x9a\xb7\x99\x5d\x60\x4a\xae\x81\x6b\x60\xa0\x79\x8e\x19\x53\x31\x30\x91\xc3\x72\x6b\x85\x85\xb0\xa8\xd5\x7a\x4b\xbe\x1f\xe9\x71\x65\x83\x83\xb6\x47\x83\xb6\x09\xe5\x5b\xd5\x5c\x54\x9c\x72\x9f\xce\xdc\x36\xb7\xdb\x14\xb3\x53\x94\x4e\xe3\xa9\x3f\xb9\x29\xef\xd0\xf9\x83\x4b\x31\x43\xc5\x65\x1e\x9e\xfc\xfc\x8e\x4a\x6d\x72\x6f\xbd\x47\xc9\xb4\x67\xdd\x95\xc8\x1b\xc9\x85\x09\x29\x74\x07\x64\xa6\x42\x63\xd6\x2a\x0c\xbb\x84\xf4\xf4\x88\x48\xdc\x39\x1e\x96\x91\xa6\x44\x45\x31\x6c\xcc\x89\x76\x4e\x4f\xbf\x1a\x2e\x14\x32\x83\x79\x10\xf9\x7b\x0e\xfb\xab\x67\xdd\xb2\x14\x64\xb4\x9e\x7c\xda\x57\xc8\x53\x78\xb3\x08\xac\x52\x11\x1d\x5a\xdf\x33\x0d\x69\x27\x70\x39\xa6\xb9\x70\x6c\xc4\x9e\xa3\x1f\xd3\xa2\x3b\x57\x09\xc3\x28\xda\xa2\xc3\x31\x92\x69\x76\xcd\xeb\x04\xa0\x97\xd8\xb2\xd2\xf7\xba\xae\x26\xa1\xc4\x72\x14\x48\xce\x8a\x92\xa9\x98\xcb\xcb\x30\xd0\x86\x29\x32\xe8\xc8\xfa\x52\x05\x31\xb8\x05\x37\xe4\x91\x80\xa2\x84\x5a\x07\xa7\xd0\xfd\xd1\x6f\x0a\x5a\xd0\x1b\x70\xa4\x98\xc1\xe0\x74\xaf\x41\xbe\xf7\x1c\xf9\xbd\x57\xc7\xf6\x9b\xc6\xba\xd8\x7f\xf6\xbb\x72\xf3\xd2\x5f\xbd\x83\xe1\x40\x3d\xd9\x47\x29\x96\x77\x3e\x7e\x88\xa1\x6f\x28\xe0\x5d\xff\x2d\xe9\x3d\x1b\x1d\xac\x44\x74\x06\xba\xe8\x0d\x02\xb7\x2f\xd4\xf2\x3d\x9b\xb6\x48\xa5\x78\x94\xe8\xd3\x4b\x28\x50\xa0\xa2\x0a\x94\xc0\x54\x80\x54\x84\x39\x97\x6a\x50\x95\xa8\x63\x29\xd5\x57\x08\x99\x81\x0a\x99\x36\xb0\xe4\xa6\xec\x32\xd7\x0a\x21\x9d\xa2\x9e\x42\xb6\x11\xa1\x6e\xb5\xe9\x7f\x62\x57\xb5\x61\x7a\xa9\xa1\x15\x7c\x2e\x55\x5d\xad\x81\x19\x50\x4c\xe4\xb2\x86\xb9\x92\xb5\x45\x40\x61\xb8\x42\x72\x7d\x86\x44\x40\xd4\x5e\x7c\xfc\x90\x74\x5b\x7c\x92\x0a\x70\x65\x77\x8d\x47\x96\xac\x8e\x14\x5b\x8f\x77\xcf\x25\x6a\xcb\xf3\xb9\xb4\xda\x12\xc4\xe0\x24\x4a\xd9\xfb\x4e\xfb\x4d\xf1\x3f\xab\x96\x6c\xad\xbb\xe1\x30\xb2\x89\x9e\xa6\xf0\xfa\x9a\x99\x6d\x43\xce\x99\xc6\x3c\x1c\xc7\x68\x7a\x79\x47\x2c\xea\xa6\x5e\x46\x3e\x1a\x76\x78\x28\x51\x23\xd4\x6c\xc5\xeb\xb6\xd6\xc0\x14\x92\xd7\x8b\x96\xa9\x1c\x58\xc1\xa8\x35\x07\x2d\x6b\x34\x25\x05\xa4\x90\xf4\xb9\x54\x52\x14\x96\x5c\x35\x0a\xba\x5d\x00\x03\xd3\x51\x76\xce\x0c\x83\x56\xe0\xaa\xc1\xcc\x60\x5e\xad\x5f\x18\xde\x30\x71\xcd\x6b\x6e\xf4\xb8\xf1\xe9\xc6\x6c\x09\x3d\xeb\xfb\xf4\x0b\xd9\x0a\x63\x27\x4e\xe1\xe4\xf8\xd8\x36\x22\x57\x0b\x14\x66\x7b\x82\xfe\xfa\xc9\x6b\x2e\xbe\xee\xce\xf5\x93\xcf\xce\xe2\x73\x66\xb2\x12\x15\x31\x7f\x2d\x15\x02\xce\xe7\x3c\x23\x0e\x8c\x41\x2f\xb9\xc9\x4a\xb2\x9f\x1b\x60\x73\x4a\x26\x6a\x83\x6d\xe1\xd8\xb1\x62\x2d\xb2\xad\x9c\x73\xd0\x23\x11\xb7\xcf\xae\xcc\x17\xb6\xb0\x1e\x9e\xf3\xa2\x55\x08\xb2\x35\x50\xca\x25\x4c\xdf\xd6\xce\xb9\xe4\xfd\xe1\xd8\xd2\x41\x1f\x72\x73\xce\x95\x36\x2f\x4e\xd2\xc0\x80\xbd\x9c\x2b\x02\xaf\x91\xe1\xe1\xbe\xf1\xfb\x9b\xc6\x57\x1a\x46\xd8\xdf\x2d\x12\xbb\x3a\x72\x33\x0d\x31\x59\x9a\x7e\x4f\xdb\xfc\x49\xaa\x07\xd4\xc6\x06\x0c\x99\xb0\x0d\xc5\x93\xe5\x93\x9c\x3a\x80\x56\x70\xd3\x87\x29\x26\x48\x3a\x97\x35\xa7\xea\xa3\x6d\x9a\x6a\xda\x02\xd8\x93\x5c\xa0\x65\x17\xd9\x1a\x6a\x10\x6c\x7e\x6f\xad\x4d\x60\x6a\xa0\x53\x4f\x03\x13\xc0\xc5\x51\x8d\xb5\x54\x6b\xc2\x1c\xc8\x75\xee\x48\x80\xdb\x46\xa1\x0f\x54\x6e\xd9\x5a\x27\xdf\x7d\x15\x70\x36\x85\x11\x84\xef\x86\xeb\x56\x32\x15\x37\x76\xc7\xbf\x76\x09\x18\x74\x3b\x9d\xc0\x06\xeb\x16\x97\xbb\x70\x61\x74\xb8\xda\xe2\xb0\xe5\x49\x72\xfc\xd7\x2a\xab\x0b\x29\xee\xab\x55\x69\x0a\x37\xed\xea\xde\x3e\x5e\xdc\xf0\x3c\xaf\x70\x49\x0c\xd3\xbb\xb9\xde\x0c\x99\x92\x19\xd0\xa5\x6d\x90\x9f\x10\x98\x31\x2c\x2b\x31\xa7\x60\x33\xd8\x7a\x05\x70\x2f\x21\x09\x41\x4f\x4d\x47\xb4\x66\x69\x59\x56\x14\xfa\x14\x6c\x7d\xd6\x5d\x3c\xba\x06\x90\xe5\x79\xf7\xbb\xbb\x7e\x02\x17\x73\x49\xb0\x74\x36\x14\xfe\xbb\x45\x6d\x8e\x74\x83\x19\x9f\xf3\xac\x2f\xe6\x84\x7e\xc7\x8b\xd2\x80\x90\x4b\x58\x22\x48\x51\xad\x41\xb7\x8d\x7d\x76\x21\x21\x0a\x3f\xd5\x13\x2e\x2c\x10\xd5\x14\x66\x3a\x2b\x2e\x99\x61\xb9\xb4\x2d\x0f\x66\xa6\x3f\x15\x7b\xfc\x10\x92\x2d\x3c\xc3\x5b\x56\xa3\xbb\xf8\x46\x40\xc2\x61\x69\x4c\x93\x7c\x61\x22\xa7\x0a\x07\xdb\xbf\xba\x6b\x5f\x45\x9e\xb0\x4d\x9d\x7d\x12\x49\xf6\x63\xc6\xc3\x3c\x11\xc5\x26\x77\x75\x68\xe3\xf9\x79\x1f\x01\x44\xd1\x6e\xb3\x74\x96\x5b\x8a\xdf\xf8\x7e\x2b\x6c\xc1\x26\xfe\x9d\xde\xf0\xba\xe6\xbd\x70\x67\xc1\xc8\xcc\x4f\xb4\xde\x82\xa8\x65\xb7\xee\x0e\x75\x23\x85\xc6\x3f\x15\xb7\xe7\x4a\xc1\x3b\x37\x6e\x83\x16\x75\x17\xae\x34\xed\xad\x84\x92\x69\xc0\x15\x45\x99\x52\xd2\xe6\x7e\xc3\x44\x62\x63\xd8\xb4\x86\x58\x9d\x0b\x17\xf9\xcc\xac\x76\xa3\x4e\x68\x0b\xa6\x20\x63\x4a\x71\x1c\x3f\x14\x7c\xb1\x57\xfd\x0b\x37\x33\x39\x3c\xf7\x8d\x7a\xda\xff\xb5\x56\x99\x19\xa2\x7d\x20\x6a\xc9\x55\xb7\x43\xa8\xfa\x97\x85\x30\x8a\x7b\x4b\xa8\x47\xf2\x74\x83\xcb\xe4\xb2\xad\x9b\x50\x39\x8d\xed\x30\x91\x85\xce\x06\xee\xb0\xb5\xf8\x45\xef\x4b\x83\x03\xec\x18\xac\x5b\x1f\x59\xa3\xf5\x61\x98\x2d\xb5\x2c\x80\xe2\x39\x09\xf7\xaa\x90\x55\x61\xf0\xff\x47\x2e\xb4\x47\xd3\xcb\xc0\x8a\xf1\x39\x90\xe4\xe6\xc2\xee\x79\x9a\x78\x68\x68\x11\x74\x38\xbc\xea\x25\xf7\x36\x83\x76\x60\x62\x02\xe8\xf6\x74\x4f\x06\x7f\x13\x46\x8f\xbd\xd0\xf7\x59\x61\xd4\x2f\x88\xdc\x2e\x7e\xef\x56\x17\xb5\xce\x21\x6e\x61\xdf\x02\x6d\xb9\xf7\x05\x74\xe7\xa0\xf7\x9d\x7f\x2e\x2a\x29\x30\x74\x70\xbb\x81\x7c\x3f\x44\xd2\x39\xab\x8b\xe4\x0e\xde\x6f\xa0\xb3\xe4\x0b\xd3\x83\xc6\xbd\x0b\x1a\x26\xa6\x97\x71\xa7\xe0\xf4\xd2\xae\xcc\xec\xd2\x91\x59\x31\x8d\xbe\xb4\xd6\x42\x8c\x88\x62\xc3\xb1\xa7\x40\x0e\x73\xf0\x01\xfd\x70\x7b\x44\x6e\xe3\xde\x02\x3a\x39\x5e\x97\x2e\xb9\x63\xcd\x4c\x8a\x05\x12\x85\x97\xb8\x72\xa4\xa8\xed\x53\x9e\xed\xc5\x89\x73\x63\xd0\x92\x92\x03\x4c\x29\x35\xd2\x0f\x4b\xbb\x99\x54\x0a\xab\xee\xb6\x59\xc9\x42\x5b\xf2\xb7\xfb\x6a\x7b\x8b\xd0\x76\x27\x3e\x87\x0a\x45\xd8\xeb\x03\x93\x09\xfc\xf4\x1e\x7e\xfc\xd1\x8e\x76\x2a\xdb\xc1\x93\x8f\xf0\x0d\x28\x8b\x47\x4f\x17\x1d\xcd\x9f\xd2\xec\xd3\xda\x20\x84\x3f\xbd\x3f\xca\x4a\xa6\x48\xd9\x28\x86\x5f\xdd\xe8\xc9\xc7\xcd\xa8\xbb\x7b\xd8\x6e\xb9\xa1\xbe\x22\xef\x14\xf1\x9c\x0a\xe7\x3a\x86\x47\xf2\x7d\x89\xab\xe4\x12\x33\x99\xa3\x73\xf1\xc8\x67\xfb\xee\xa5\xdb\x49\x95\x9c\xe5\x79\xff\x2b\xb0\x2b\x1f\x79\x1e\xc4\xdd\x5a\x6f\xfc\xde\x93\x07\x31\x74\xff\x22\x48\xce\x79\x71\x25\x72\xce\x44\xf2\x87\xf5\x6f\x38\x68\xf5\xcf\x5f\x4f\xff\xe5\x8e\x74\x7f\x54\x0e\xab\xea\x1c\xf7\xd7\x35\xa5\x85\x7f\x4f\xd1\x5e\xa5\x5e\xc7\x67\xbf\xff\x28\x13\x5b\x68\xbf\x3c\x3c\xcc\x42\xb5\x8c\xc1\x12\x1d\xb5\x9f\xde\xb3\xeb\x49\xb6\xda\x9b\x4d\xcb\xb7\x69\xb4\x73\xd4\x99\xe2\x4f\xb6\x1b\xa7\x0e\x9c\x35\x4d\xc5\xbb\x67\x29\xdb\x19\xfc\x41\xad\xa7\xbd\xa8\xa2\xb1\xc7\xad\x6d\xba\x28\xdb\x9a\x61\x5b\xa3\xe1\x96\xbe\x69\xa3\xf6\xdc\xad\x29\x11\xa9\xe2\xb0\xa6\xd9\xea\x01\x76\xea\xef\x45\xff\x84\xd2\xaf\x72\x8f\x31\xdb\xaf\xa9\xb3\xdf\x2f\x1f\x89\x33\xb7\x98\xb2\xc7\x1c\x3f\xbb\x9e\xcd\x66\x8f\xb7\x67\x37\x57\x84\xb1\x79\x42\xdd\x92\xf8\x5e\xa4\x11\x90\xef\x29\x77\x32\x06\x13\x6f\x50\x15\x18\xda\x8a\xef\x46\x2e\xbb\xeb\xb2\x7d\xa4\xda\x8c\xde\xe2\x92\x38\x71\x8b\x89\x2d\xc7\x75\xff\x54\x48\xee\xb3\x12\x6b\xf6\xc7\xdd\x75\x3c\x1a\xdd\xb4\x38\xff\x87\xeb\x9e\x91\x9c\x9a\x16\xde\xdd\x81\x5c\xb7\xa1\xfc\x67\xff\x3f\x01\x00\x00\xff\xff\x50\x95\xff\x01\x49\x1b\x00\x00")
func _hardcodedTracingGoBytes() ([]byte, error) {
return bindataRead(
@@ -127,7 +127,7 @@ func _hardcodedTracingGo() (*asset, error) {
}
info := bindataFileInfo{name: "../_hardcoded/tracing.go", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
- a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x91, 0x5b, 0x60, 0x67, 0xc0, 0x1, 0xc2, 0x25, 0xe5, 0x52, 0x40, 0xa6, 0x17, 0x69, 0xb6, 0xc7, 0x37, 0x35, 0x0, 0x48, 0xd5, 0x4f, 0x7c, 0x7d, 0x2b, 0x18, 0x77, 0xdd, 0x0, 0x32, 0x7b, 0xea}}
+ a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf8, 0x9e, 0x3c, 0x18, 0xa1, 0x12, 0xf0, 0x56, 0x7e, 0xd1, 0xc3, 0x3e, 0x9c, 0x7f, 0xb7, 0x63, 0x43, 0x25, 0xd3, 0xd7, 0x1d, 0x9d, 0x97, 0x7c, 0xcf, 0x6d, 0x1d, 0xc7, 0xf4, 0x1a, 0x1a, 0xfd}}
return a, nil
}

ADD
package-lock.json
+{}

ADD
package.json
+{}

MODIFY
samples/gen-go/client/client.go
samples/gen-go/client/client.go
@@ -16,7 +16,7 @@ import (
"github.com/Clever/swagger-test/gen-go/models"
discovery "github.com/Clever/discovery-go"
- wcl "github.com/Clever/wag/wagclientlogger"
+ wcl "github.com/Clever/wag/logging/wagclientlogger"
"github.com/afex/hystrix-go/hystrix"
@@ -166,11 +166,12 @@ func newResource() *resource.Resource {
}
func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64) *sdktrace.TracerProvider {
- return sdktrace.NewTracerProvider(
+
+ tp := sdktrace.NewTracerProvider(
// We use the default ID generator. In order for sampling to work (at least with this sampler)
// the ID generator must generate trace IDs uniformly at random from the entire space of uint64.
// For example, the default x-ray ID generator does not do this.
- sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(samplingProbability))),
+ sdktrace.WithSampler(sdktrace.AlwaysSample()),
// These maximums are to guard against something going wrong and sending a ton of data unexpectedly
sdktrace.WithSpanLimits(sdktrace.SpanLimits{
AttributeCountLimit: 100,
@@ -182,6 +183,9 @@ func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float
//sdktrace.WithBatcher(exporter),
sdktrace.WithResource(newResource()),
)
+ otel.SetTracerProvider(tp)
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
+ return tp
}
func doNothing(baseTransport http.RoundTripper, spanNameCtxValue interface{}, tp sdktrace.TracerProvider) http.RoundTripper {
@@ -210,7 +214,7 @@ func determineSampling() (samplingProbability float64, err error) {
//----------------------END TRACING RELATEDFUNCTIONS----------------------
// New creates a new client. The base path and http transport are configurable.
-func New(basePath string, opts ...Option) *WagClient {
+func New(ctx context.Context, basePath string, opts ...Option) *WagClient {
defaultTransport := http.DefaultTransport
defaultLogger := NewLogger("swagger-test-wagclient", wcl.Info)
@@ -240,7 +244,7 @@ func New(basePath string, opts ...Option) *WagClient {
// samplingProbability := determineSampling()
tp := newTracerProvider(options.exporter, samplingProbability)
- options.transport = options.instrumentor(options.transport, context.TODO(), *tp)
+ options.transport = options.instrumentor(options.transport, ctx, *tp)
circuit := &circuitBreakerDoer{
d: &retry,
@@ -255,7 +259,7 @@ func New(basePath string, opts ...Option) *WagClient {
basePath: basePath,
requestDoer: circuit,
client: &http.Client{
- Transport: defaultTransport,
+ Transport: options.transport,
},
retryDoer: &retry,
circuitDoer: circuit,
@@ -276,7 +280,7 @@ func NewFromDiscovery() (*WagClient, error) {
return nil, err
}
}
- return New(url), nil
+ return New(context.Background(), url), nil
}
// SetRetryPolicy sets a the given retry policy for all requests.

MODIFY
samples/gen-go/client/doer.go
samples/gen-go/client/doer.go
@@ -13,7 +13,7 @@ import (
"sync"
"time"
- wcl "github.com/Clever/wag/wagclientlogger"
+ wcl "github.com/Clever/wag/logging/wagclientlogger"
"github.com/afex/hystrix-go/hystrix"
"github.com/donovanhide/eventsource"

MODIFY
samples/gen-go/servertracing/tracing.go
samples/gen-go/servertracing/tracing.go
@@ -11,6 +11,7 @@ import (
"time"
"github.com/Clever/kayvee-go/v7/logger"
+ "github.com/davecgh/go-spew/spew"
"go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
@@ -30,12 +31,12 @@ var defaultCollectorPort uint16 = 4317
// propagator to use.
var propagator propagation.TextMapPropagator = propagation.TraceContext{} // traceparent header
func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExporter, *sdktrace.TracerProvider, error) {
- // 1. set up exporter
- // 2. set up tracer provider
- // 3. assign global tracer provider
+ otel.SetTextMapPropagator(
+ propagation.NewCompositeTextMapPropagator(
+ propagation.TraceContext{},
+ propagation.Baggage{}),
+ )
- // If we're running locally, then turn off sampling. Otherwise sample
- // 1% or whatever TRACING_SAMPLING_PROBABILITY specifies.
samplingProbability := 0.01
isLocal := os.Getenv("_IS_LOCAL") == "true"
if isLocal {
@@ -78,7 +79,7 @@ func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExpo
}
func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64, resource *resource.Resource) *sdktrace.TracerProvider {
- return sdktrace.NewTracerProvider(
+ tp := sdktrace.NewTracerProvider(
// We use the default ID generator. In order for sampling to work (at least with this sampler)
// the ID generator must generate trace IDs uniformly at random from the entire space of uint64.
// For example, the default x-ray ID generator does not do this.
@@ -96,6 +97,10 @@ func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float
//Have to figure out how I'm going to generate this resource first.
sdktrace.WithResource(resource),
)
+ otel.SetTracerProvider(tp)
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
+
+ return tp
}
// SetupGlobalTraceProviderAndExporterForTest is meant to be used in unit testing,
@@ -112,11 +117,19 @@ func SetupGlobalTraceProviderAndExporterForTest() (*tracetest.InMemoryExporter,
// It does two things: starts spans, and adds span/trace info to the request-specific logger.
// Right now we only support logging IDs in the format that Datadog expects.
func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler {
- otlmux := otelmux.Middleware(serviceName, otelmux.WithPropagators(propagator))
+ otlmux := otelmux.Middleware(serviceName, otelmux.WithPropagators(otel.GetTextMapPropagator()))
fmt.Println("Adding mux server middleware")
return func(h http.Handler) http.Handler {
return otlmux(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
// otelmux has extracted the span. now put it into the ctx-specific logger
+ var carrier propagation.HeaderCarrier = propagation.HeaderCarrier{}
+
+ // otelmux has extracted the span. now put it into the ctx-specific logger
+ ctx := otel.GetTextMapPropagator().Extract(r.Context(), carrier)
+ spew.Dump(r.Header)
+ testsc := trace.SpanFromContext(ctx).SpanContext()
+ spew.Dump(testsc)
+
s := trace.SpanFromContext(r.Context())
rid := r.Header.Get("X-Request-ID")
if rid != "" {
@@ -124,8 +137,15 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler {
} else {
s.SetAttributes(attribute.String("X-Request-ID", s.SpanContext().TraceID().String()))
}
+
+ testctx := trace.ContextWithSpanContext(ctx, s.SpanContext())
+ r2 := r.Clone(testctx)
+ spew.Dump(r2.Header)
+
if sc := s.SpanContext(); sc.HasTraceID() {
spanID, traceID := sc.SpanID().String(), sc.TraceID().String()
+ fmt.Println("span/trace: ", spanID, " ", traceID)
+ spew.Dump(sc)
// datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works
if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids
traceIDBs, _ := hex.DecodeString(traceID)

MODIFY
tracing/tracing.go
tracing/tracing.go
@@ -8,7 +8,8 @@ import (
"time"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
-
+ "go.opentelemetry.io/otel/exporters/jaeger"
+ "go.opentelemetry.io/otel/"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
@@ -71,24 +72,13 @@ func OtlpGrpcExporter(ctx context.Context, opts ...Option) sdktrace.SpanExporter
}
-func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64, resource *resource.Resource) *sdktrace.TracerProvider {
- return sdktrace.NewTracerProvider(
- // We use the default ID generator. In order for sampling to work (at least with this sampler)
- // the ID generator must generate trace IDs uniformly at random from the entire space of uint64.
- // For example, the default x-ray ID generator does not do this.
- sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(samplingProbability))),
- // These maximums are to guard against something going wrong and sending a ton of data unexpectedly
- sdktrace.WithSpanLimits(sdktrace.SpanLimits{
- AttributeCountLimit: 100,
- EventCountLimit: 100,
- LinkCountLimit: 100,
- }),
- //Batcher is more efficient, switch to it after testing
- sdktrace.WithSyncer(exporter),
- //sdktrace.WithBatcher(exporter),
- //Have to figure out how I'm going to generate this resource first.
- sdktrace.WithResource(resource),
- )
+func JaegerExporter() (spanExporter sdktrace.SpanExporter) {
+ fmt.Println("Creating Jaeger Exporter")
+ spanExporter, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint("http://localhost:14268/api/traces")))
+ if err != nil {
+ log.Fatal("Error creating Jaeger Exporter")
+ }
+ return
}
// InstrumentedTransport returns the transport to use in client requests.
@@ -109,7 +99,8 @@ func (rt roundTripperWithTracing) RoundTrip(r *http.Request) (*http.Response, er
return otelhttp.NewTransport(
rt.baseTransport,
- otelhttp.WithTracerProvider(&rt.tp),
+ otelhttp.WithTracerProvider(otel.GetTracerProvider())
+ // otelhttp.WithTracerProvider(&rt.tp),
// otelhttp.WithTracerProvider(tracer),
otelhttp.WithPropagators(propagator),
otelhttp.WithSpanNameFormatter(func(method string, r *http.Request) string {

MODIFY
wag
wag
Binary files a/wag and b/wag differ

added jaeger exporter for easier local testing