Skip to content

Commit

Permalink
Remove unnecessary context in prometheus receiver (open-telemetry#9766)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored and djaglowski committed May 10, 2022
1 parent 133b5da commit 31b699a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
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

0 comments on commit 31b699a

Please sign in to comment.