-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Status subcommand reporting agent status for otel mode - Phase 2 (#4047)
* Status subcommand reporting agent status for otel mode * changed error handling * changed error handling * check status works and returns healthy in otel e2e test * lint
- Loading branch information
1 parent
91c0a94
commit c588a73
Showing
8 changed files
with
120 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package otel | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" | ||
) | ||
|
||
// OtelModeConfigManager serves as a config manager for OTel use cases | ||
// In this case agent should ignore all configuration coming from elastic-agent.yml file | ||
// or other sources. | ||
type OtelModeConfigManager struct { | ||
ch chan coordinator.ConfigChange | ||
errCh chan error | ||
} | ||
|
||
// NewOtelModeConfigManager creates new OtelModeConfigManager ignoring | ||
// configuration coming from other sources. | ||
func NewOtelModeConfigManager() *OtelModeConfigManager { | ||
return &OtelModeConfigManager{ | ||
ch: make(chan coordinator.ConfigChange), | ||
errCh: make(chan error), | ||
} | ||
} | ||
|
||
func (t *OtelModeConfigManager) Run(ctx context.Context) error { | ||
<-ctx.Done() | ||
return ctx.Err() | ||
} | ||
|
||
func (t *OtelModeConfigManager) Errors() <-chan error { | ||
return t.errCh | ||
} | ||
|
||
// ActionErrors returns the error channel for actions. | ||
// Returns nil channel. | ||
func (t *OtelModeConfigManager) ActionErrors() <-chan error { | ||
return nil | ||
} | ||
|
||
func (t *OtelModeConfigManager) Watch() <-chan coordinator.ConfigChange { | ||
return t.ch | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters