Skip to content

Commit

Permalink
chore: remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
maier committed Jan 3, 2024
1 parent ce98497 commit 4aa99db
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions plugins/inputs/circ_http_json/circ_http_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,11 @@ func (chj *CHJ) Gather(ctx context.Context, _ cua.Accumulator) error {
return fmt.Errorf("instance_id: %s -- no metric destination configured", chj.InstanceID)
}

start := time.Now()

data, err := chj.getURL(ctx)
if err != nil {
return fmt.Errorf("instance_id: %s -- fetching metrics from %s: %w", chj.InstanceID, chj.URL, err)
}

chj.Log.Infof("got metrics (%d bytes) from %s in %s", len(data), chj.URL, time.Since(start).String())

if err := chj.hasStreamtags(data); err != nil {
return fmt.Errorf("instance_id: %s -- no streamtags found in metrics", chj.InstanceID)
}
Expand All @@ -129,14 +125,9 @@ func (chj *CHJ) Gather(ctx context.Context, _ cua.Accumulator) error {
// return fmt.Errorf("instance_id: %s -- invalid json from %s: %w", chj.InstanceID, chj.URL, err)
// }

start2 := time.Now()

if _, err := chj.dest.FlushRawJSON(ctx, data); err != nil {
return fmt.Errorf("instance_id: %s -- flushing metrics: %w", chj.InstanceID, err)
}
chj.Log.Infof("sent metrics (%d bytes) in %s", len(data), time.Since(start2).String())

chj.Log.Infof("total fetch and submission time %s", time.Since(start).String())

return nil
}
Expand Down

0 comments on commit 4aa99db

Please sign in to comment.