Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change obsreport receiver calling pattern in dockerstatsreceiver #3449

Merged
merged 9 commits into from
May 24, 2021
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The OpenTelemetry Collector Contrib contains everything in the [opentelemetry-co
- `groupbytrace` processor: Added workers for queue processing (#2902)
- `resourcedetection` processor: Add docker detector (#2775)
- `tailsampling` processor: Support regex on span attribute filtering (#3335_
- Change obsreport helpers for receiver to use the new pattern created in Collector (#3439,#3443)
- Change obsreport helpers for receiver to use the new pattern created in Collector (#3439,#3443,#3449)

## 🧰 Bug fixes 🧰

Expand Down
6 changes: 4 additions & 2 deletions receiver/dockerstatsreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Receiver struct {
runnerCancel context.CancelFunc
successfullySetup bool
transport string
obsrecv *obsreport.Receiver
}

func NewReceiver(
Expand All @@ -67,6 +68,7 @@ func NewReceiver(
nextConsumer: nextConsumer,
logger: logger,
transport: parsed.Scheme,
obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: config.ID(), Transport: parsed.Scheme}),
}

return &receiver, nil
Expand Down Expand Up @@ -120,7 +122,7 @@ func (r *Receiver) Run() error {
return r.Setup()
}

c := obsreport.StartMetricsReceiveOp(r.obsCtx, r.config.ID(), r.transport)
c := r.obsrecv.StartMetricsReceiveOp(r.obsCtx)

containers := r.client.Containers()
results := make(chan result, len(containers))
Expand Down Expand Up @@ -156,6 +158,6 @@ func (r *Receiver) Run() error {
}
}

obsreport.EndMetricsReceiveOp(c, typeStr, numPoints, lastErr)
r.obsrecv.EndMetricsReceiveOp(c, typeStr, numPoints, lastErr)
return nil
}