File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "encoding/json"
55 "flag"
66 "fmt"
7- "io"
87 "net/http"
98 "os"
109 "path/filepath"
@@ -228,20 +227,9 @@ func (s *SystemMonitor) sendMetric(metric Metric) error {
228227 }
229228 defer resp .Body .Close ()
230229
231- // Read response body
232- respBody , err := io .ReadAll (resp .Body )
233- if err != nil {
234- return fmt .Errorf ("failed to read response body: %v" , err )
235- }
236-
237- // Log response details without colors
238230 s .log .Log ("Response Status: %s" , resp .Status )
239- if len (respBody ) > 0 {
240- s .log .Log ("Response Body: %s" , string (respBody ))
241- }
242-
243231 if resp .StatusCode >= 400 {
244- return fmt .Errorf ("request failed with status: %d, body: %s " , resp .StatusCode , string ( respBody ) )
232+ return fmt .Errorf ("request failed with status: %d" , resp .StatusCode )
245233 }
246234
247235 return nil
You can’t perform that action at this time.
0 commit comments