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

Remove unnecessary context in prometheus receiver #9766

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions receiver/prometheusreceiver/internal/ocastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ var idSeq int64

// OcaStore translates Prometheus scraping diffs into OpenCensus format.
type OcaStore struct {
ctx context.Context

sink consumer.Metrics
jobsMap *JobsMap
useStartTimeMetric bool
Expand All @@ -43,7 +41,6 @@ type OcaStore struct {

// NewOcaStore returns an ocaStore instance, which can be acted as prometheus' scrape.Appendable
func NewOcaStore(
ctx context.Context,
sink consumer.Metrics,
set component.ReceiverCreateSettings,
gcInterval time.Duration,
Expand All @@ -56,7 +53,6 @@ func NewOcaStore(
jobsMap = NewJobsMap(gcInterval)
}
return &OcaStore{
ctx: ctx,
sink: sink,
settings: set,
jobsMap: jobsMap,
Expand Down
3 changes: 0 additions & 3 deletions receiver/prometheusreceiver/metrics_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ func (r *pReceiver) Start(_ context.Context, host component.Host) error {
}
}()

// Per component.Component Start instructions, for async operations we should not use the
// incoming context, it may get cancelled.
r.ocaStore = internal.NewOcaStore(
context.Background(),
r.consumer,
r.settings,
gcInterval(r.cfg.PrometheusConfig),
Expand Down