Skip to content

Commit

Permalink
[chore][extension] update NotifyConfig contract (#9005)
Browse files Browse the repository at this point in the history
**Description:**
The collector implementation makes a copy of effective configuration
before calling `NotifyConfig` so it's safe for the config watcher to
save the pointer and use it later. It is resonable to promise this in
the API contract.

**Link to tracking Issue:**
open-telemetry/opentelemetry-collector-contrib#29277 (comment)

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
  • Loading branch information
haoqixu and evan-bradley committed Nov 28, 2023
1 parent 4966509 commit 7d2cb74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type PipelineWatcher interface {
// wishes to be notified of the Collector's effective configuration.
type ConfigWatcher interface {
// NotifyConfig notifies the extension of the Collector's current effective configuration.
// The extension owns the `confmap.Conf`. Callers must ensure that it's safe for
// extensions to store the `conf` pointer and use it concurrently with any other
// instances of `conf`.
NotifyConfig(ctx context.Context, conf *confmap.Conf) error
}

Expand Down

0 comments on commit 7d2cb74

Please sign in to comment.