Skip to content

Commit eb2e8d6

Browse files
committed
test changes
1 parent dbc55ed commit eb2e8d6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

internal/extension/extension.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ func BuildExtensionManager(isUniversalInstrumentation bool) *ExtensionManager {
8787
}
8888

8989
func (em *ExtensionManager) checkAgentRunning() {
90+
fmt.Printf("[DEBUG] checkAgentRunning()\n")
9091
if _, err := os.Stat(em.extensionPath); err != nil {
9192
logger.Debug("Will use the API")
93+
fmt.Printf("[DEBUG] Extension is not running\n")
9294
em.isExtensionRunning = false
9395
} else {
96+
fmt.Printf("[DEBUG] Extension is running\n")
9497
logger.Debug("Will use the Serverless Agent")
9598
em.isExtensionRunning = true
9699

100+
fmt.Printf("[DEBUG] universal instrumentation: %t\n", em.isUniversalInstrumentation)
101+
97102
// Tell the extension not to create an execution span if universal instrumentation is disabled
98103
if !em.isUniversalInstrumentation {
99104
req, _ := http.NewRequest(http.MethodGet, em.helloRoute, nil)
@@ -108,10 +113,12 @@ func (em *ExtensionManager) checkAgentRunning() {
108113
}
109114

110115
func (em *ExtensionManager) SendStartInvocationRequest(ctx context.Context, eventPayload json.RawMessage) context.Context {
116+
fmt.Println("[DEBUG] SendStartInvocationRequest()")
111117
body := bytes.NewBuffer(eventPayload)
112118
req, _ := http.NewRequest(http.MethodPost, em.startInvocationUrl, body)
113119

114120
if response, err := em.httpClient.Do(req); err == nil && response.StatusCode == 200 {
121+
fmt.Printf("[DEBUG] SendStartInvocationRequest succeeded\n")
115122
// Propagate dd-trace context from the extension response if found in the response headers
116123
traceId := response.Header.Get(string(DdTraceId))
117124
if traceId != "" {

internal/trace/listener.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ func (l *Listener) HandlerStarted(ctx context.Context, msg json.RawMessage) cont
7373
return ctx
7474
}
7575

76+
fmt.Printf("[DEBUG] universal instrumentation: %t\v", l.universalInstrumentation)
77+
fmt.Printf("[DEBUG] extension running: %t\v", l.extensionManager.IsExtensionRunning())
7678
if l.universalInstrumentation && l.extensionManager.IsExtensionRunning() {
7779
ctx = l.extensionManager.SendStartInvocationRequest(ctx, msg)
7880
}

0 commit comments

Comments
 (0)