Skip to content

Commit

Permalink
Fix zpages type data for SFx receiver (#153)
Browse files Browse the repository at this point in the history
* Fix zpages type data for SFx receiver

The issue was the use of incorrect obsreport function to start the operation. Since the other functions were correct this only affected the pages. Also upon inspection noticed a missing cal to span.End if the receive operation ended before ingress data could be decoded.

* Testbed: increase memory usage for Carbon receiver test

This failed on CircleCI saying that it reached 61MiB, the code isn't affected by PR.
  • Loading branch information
pjanotti authored Mar 29, 2020
1 parent a6f82a5 commit 02c95b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion receiver/signalfxreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (r *sfxReceiver) Shutdown() error {

func (r *sfxReceiver) handleReq(resp http.ResponseWriter, req *http.Request) {
ctx := obsreport.ReceiverContext(req.Context(), r.config.Name(), "http", r.config.Name())
ctx = obsreport.StartTraceDataReceiveOp(ctx, r.config.Name(), "http")
ctx = obsreport.StartMetricsReceiveOp(ctx, r.config.Name(), "http")

if req.Method != http.MethodPost {
r.failRequest(ctx, resp, http.StatusBadRequest, invalidMethodRespBody, nil)
Expand Down Expand Up @@ -255,6 +255,7 @@ func (r *sfxReceiver) failRequest(
traceStatus.Message = err.Error()
}
reqSpan.SetStatus(traceStatus)
reqSpan.End()

r.logger.Debug(
"SignalFx receiver request failed",
Expand Down
2 changes: 1 addition & 1 deletion testbed/tests/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestMetric10kDPS(t *testing.T) {
NewCarbonDataReceiver(testbed.GetAvailablePort(t)),
testbed.ResourceSpec{
ExpectedMaxCPU: 115,
ExpectedMaxRAM: 60,
ExpectedMaxRAM: 65,
},
},
{
Expand Down

0 comments on commit 02c95b3

Please sign in to comment.