@@ -87,13 +87,18 @@ func BuildExtensionManager(isUniversalInstrumentation bool) *ExtensionManager {
87
87
}
88
88
89
89
func (em * ExtensionManager ) checkAgentRunning () {
90
+ fmt .Printf ("[DEBUG] checkAgentRunning()\n " )
90
91
if _ , err := os .Stat (em .extensionPath ); err != nil {
91
92
logger .Debug ("Will use the API" )
93
+ fmt .Printf ("[DEBUG] Extension is not running\n " )
92
94
em .isExtensionRunning = false
93
95
} else {
96
+ fmt .Printf ("[DEBUG] Extension is running\n " )
94
97
logger .Debug ("Will use the Serverless Agent" )
95
98
em .isExtensionRunning = true
96
99
100
+ fmt .Printf ("[DEBUG] universal instrumentation: %t\n " , em .isUniversalInstrumentation )
101
+
97
102
// Tell the extension not to create an execution span if universal instrumentation is disabled
98
103
if ! em .isUniversalInstrumentation {
99
104
req , _ := http .NewRequest (http .MethodGet , em .helloRoute , nil )
@@ -108,10 +113,12 @@ func (em *ExtensionManager) checkAgentRunning() {
108
113
}
109
114
110
115
func (em * ExtensionManager ) SendStartInvocationRequest (ctx context.Context , eventPayload json.RawMessage ) context.Context {
116
+ fmt .Println ("[DEBUG] SendStartInvocationRequest()" )
111
117
body := bytes .NewBuffer (eventPayload )
112
118
req , _ := http .NewRequest (http .MethodPost , em .startInvocationUrl , body )
113
119
114
120
if response , err := em .httpClient .Do (req ); err == nil && response .StatusCode == 200 {
121
+ fmt .Printf ("[DEBUG] SendStartInvocationRequest succeeded\n " )
115
122
// Propagate dd-trace context from the extension response if found in the response headers
116
123
traceId := response .Header .Get (string (DdTraceId ))
117
124
if traceId != "" {
0 commit comments