Skip to content

Commit

Permalink
test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhulston committed Nov 8, 2024
1 parent 6c1224a commit 6859e8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/trace/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var DefaultTraceExtractor = getHeadersFromEventHeaders
// contextWithRootTraceContext uses the incoming event and context object payloads to determine
// the root TraceContext and then adds that TraceContext to the context object.
func contextWithRootTraceContext(ctx context.Context, ev json.RawMessage, mergeXrayTraces bool, extractor ContextExtractor) (context.Context, error) {
fmt.Printf("[DEBUG] [context.go] [contextWithRootTraceContext()]\n")
fmt.Printf("[DEBUG] [context.go] [contextWithRootTraceContext()] full context: %+v\n", ctx)
datadogTraceContext, gotDatadogTraceContext := getTraceContext(ctx, extractor(ctx, ev))

xrayTraceContext, errGettingXrayContext := convertXrayTraceContextFromLambdaContext(ctx)
Expand Down Expand Up @@ -132,7 +132,7 @@ func createDummySubsegmentForXrayConverter(ctx context.Context, traceCtx TraceCo
}

func getTraceContext(ctx context.Context, headers map[string]string) (TraceContext, bool) {
fmt.Printf("[DEBUG] [context.go] [getTraceContext()]\n")
fmt.Printf("[DEBUG] [context.go] [getTraceContext()] headers: %v\n", headers)
tc := TraceContext{}

traceID := headers[traceIDHeader]
Expand Down Expand Up @@ -192,6 +192,7 @@ func getHeadersFromEventHeaders(ctx context.Context, ev json.RawMessage) map[str
lowercaseHeaders := map[string]string{}
for k, v := range eh.Headers {
lowercaseHeaders[strings.ToLower(k)] = v
fmt.Printf("[DEBUG lambda] context.go: [%s, %s]\n", strings.ToLower(k), v)
}

return lowercaseHeaders
Expand Down

0 comments on commit 6859e8a

Please sign in to comment.