Skip to content

Commit 0932a6b

Browse files
authored
Add server side apm stats computation (#606)
1 parent 1de4813 commit 0932a6b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_lambda_invocation.json~snapshot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,20 @@
739739
"path": "/api/v0.2/traces",
740740
"verb": "POST"
741741
},
742+
{
743+
"data": null,
744+
"headers": {
745+
"Accept-Encoding": "gzip",
746+
"Content-Encoding": "gzip",
747+
"Content-Length": "<redacted from snapshot>",
748+
"Content-Type": "application/json",
749+
"Dd-Api-Key": "abcdefghijklmnopqrstuvwxyz012345",
750+
"Host": "recorder:8080",
751+
"User-Agent": "<redacted from snapshot>"
752+
},
753+
"path": "/api/v0.2/stats",
754+
"verb": "POST"
755+
},
742756
{
743757
"data": {
744758
"series": [

aws/logs_monitoring/trace_forwarder/cmd/trace/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,16 @@ func sendTracesToIntake(tracePayloads []*pb.TracePayload) error {
145145
fmt.Printf("Failed to send traces with error %v\n", err)
146146
hadErr = true
147147
}
148+
stats := apm.ComputeAPMStats(tracePayload)
149+
err = edgeConnection.SendStats(context.Background(), stats, 3)
150+
if err != nil {
151+
fmt.Printf("Failed to send trace stats with error %v\n", err)
152+
hadErr = true
153+
}
148154
}
155+
149156
if hadErr {
150-
return errors.New("Failed to send traces to intake")
157+
return errors.New("Failed to send traces or stats to intake")
151158
}
152159
return nil
153160
}

0 commit comments

Comments
 (0)