-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[extension/opampextension] Fix self-reported status events dropped by non-Reporter hosts #49412
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
base: main
Are you sure you want to change the base?
Changes from all commits
32cf38d
c799e70
f2df5a3
9427401
ebb884c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: bug_fix | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog) | ||
| component: extension/opamp | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: "Fix opampextension self-reported status events (e.g. the fatal error emitted when the parent process disappears) being silently dropped when the component.Host does not implement componentstatus.Reporter" | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [49412] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| subtext: | | ||
| Previously, opampAgent.Start wired its internal reportFunc to call | ||
| componentstatus.ReportStatus(host, event) directly. The service starts | ||
| extensions with the bare graph.Host, which does not implement | ||
| componentstatus.Reporter (only pipeline components are handed a | ||
| Reporter-capable host wrapper), so ReportStatus was a silent no-op and | ||
| self-reported status changes -- most notably the fatal error monitorPPID | ||
| emits when the collector's parent process disappears -- were discarded and | ||
| never reached the extension's status aggregator, leaving the collector | ||
| reporting healthy to the OpAMP server despite being orphaned. | ||
|
|
||
| reportFunc now routes self-reported events to the extension's own | ||
| ComponentStatusChanged handler, so they reach the status aggregator and the | ||
| orphaned collector is reported unhealthy. | ||
|
|
||
| change_logs: [user] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,7 @@ type opampAgent struct { | |
| resourceAttrs map[string]string | ||
|
|
||
| instanceUID uuid.UUID | ||
| extensionID component.ID | ||
|
|
||
| eclk sync.RWMutex | ||
| effectiveConfig *confmap.Conf | ||
|
|
@@ -106,8 +107,15 @@ var ( | |
| ) | ||
|
|
||
| func (o *opampAgent) Start(ctx context.Context, host component.Host) error { | ||
| selfInstanceID := componentstatus.NewInstanceID(o.extensionID, component.KindExtension) | ||
| o.reportFunc = func(event *componentstatus.Event) { | ||
| componentstatus.ReportStatus(host, event) | ||
| // The service starts extensions with the bare graph.Host, which does not | ||
| // implement componentstatus.Reporter (only pipeline components are handed | ||
| // a Reporter-capable host wrapper). componentstatus.ReportStatus would | ||
| // therefore silently no-op, so route self-reported events -- such as the | ||
| // fatal error monitorPPID emits when the parent process disappears -- | ||
| // straight to this extension's own status aggregator. | ||
| o.ComponentStatusChanged(selfInstanceID, event) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With the normal collector service host, Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| header := http.Header{} | ||
|
|
@@ -332,6 +340,7 @@ func newOpampAgent(cfg *Config, set extension.Settings) (*opampAgent, error) { | |
| serviceVersion: serviceVersion, | ||
| serviceInstanceID: serviceInstanceID, | ||
| instanceUID: uid, | ||
| extensionID: set.ID, | ||
| capabilities: cfg.Capabilities, | ||
| opampClient: opampClient, | ||
| resourceAttrs: resourceAttrs, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.