Skip to content

Commit

Permalink
Add server side apm stats computation (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
hghotra authored Aug 24, 2022
1 parent 1de4813 commit 0932a6b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,20 @@
"path": "/api/v0.2/traces",
"verb": "POST"
},
{
"data": null,
"headers": {
"Accept-Encoding": "gzip",
"Content-Encoding": "gzip",
"Content-Length": "<redacted from snapshot>",
"Content-Type": "application/json",
"Dd-Api-Key": "abcdefghijklmnopqrstuvwxyz012345",
"Host": "recorder:8080",
"User-Agent": "<redacted from snapshot>"
},
"path": "/api/v0.2/stats",
"verb": "POST"
},
{
"data": {
"series": [
Expand Down
9 changes: 8 additions & 1 deletion aws/logs_monitoring/trace_forwarder/cmd/trace/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,16 @@ func sendTracesToIntake(tracePayloads []*pb.TracePayload) error {
fmt.Printf("Failed to send traces with error %v\n", err)
hadErr = true
}
stats := apm.ComputeAPMStats(tracePayload)
err = edgeConnection.SendStats(context.Background(), stats, 3)
if err != nil {
fmt.Printf("Failed to send trace stats with error %v\n", err)
hadErr = true
}
}

if hadErr {
return errors.New("Failed to send traces to intake")
return errors.New("Failed to send traces or stats to intake")
}
return nil
}
Expand Down

0 comments on commit 0932a6b

Please sign in to comment.