forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libbeat/management]: support filebeat inputs to report their status …
…to elastic-agent (elastic#39209) * feat(management): implement support for reporting input health including multiple streams * fix: add missing file licenses * feat(tests): update also units revision number * feat: make stream statuses explicit in reported payload * feat: define new env vars to allow overriding scheme and ssl verification in integration framework * feat: utilise the es stack used through integration framework in CEL integration test * fix: remove logging from integration test to reduce verbosity * chore: move UpdateStatus closer to error logging * Revert "feat: define new env vars to allow overriding scheme and ssl verification in integration framework" This reverts commit 214cdd1. * fix: change configStateIdx and a field in the source of input units to match the behavior of elastic-agent * fix: invoke stringer directly with go run * fix: add in godoc that StatusReporter for standalone Beat execution is expected to be nil * fix(linter): preallocate slice for list of names registered * doc: update CHANGELOG.next.asciidoc * fix(linter): disable typecheck for rest in walkMap * fix: return client.UnitStateFailed for unknown statuses * chore: rename application to unit in statuses godoc to capture better their scope * fix: do not rely on event["error"] to mark the status of cel input as running * fix: remove usage of testify assert and require packages * fix: move integration_test.go to parent directory and add comments to improve the code readability * fix: improve readability by code minor restructuring and comments revisiting * fix: remove stubborn t.Logf * fix: simplify code in calcState * fix: log when a unit is not found during a unit change event * feat: add unit ID in the unit-state named logger * feat: add unit-tests for unit.go * feat: introduce UpdateStatus at v2.Context * fix: add missing license header * feat: report at the unit level the error msg of the first FAILED or DEGRADED stream
- Loading branch information
1 parent
a6aa347
commit 38a678b
Showing
13 changed files
with
1,370 additions
and
127 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
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,55 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package status | ||
|
||
// Status describes the current status of the beat. | ||
type Status int | ||
|
||
//go:generate go run golang.org/x/tools/cmd/stringer -type=Status | ||
const ( | ||
// Unknown is initial status when none has been reported. | ||
Unknown Status = iota | ||
// Starting is status describing unit is starting. | ||
Starting | ||
// Configuring is status describing unit is configuring. | ||
Configuring | ||
// Running is status describing unit is running. | ||
Running | ||
// Degraded is status describing unit is degraded. | ||
Degraded | ||
// Failed is status describing unit is failed. This status should | ||
// only be used in the case the beat should stop running as the failure | ||
// cannot be recovered. | ||
Failed | ||
// Stopping is status describing unit is stopping. | ||
Stopping | ||
// Stopped is status describing unit is stopped. | ||
Stopped | ||
) | ||
|
||
// StatusReporter provides a method to update current status of a unit. | ||
type StatusReporter interface { | ||
// UpdateStatus updates the status of the unit. | ||
UpdateStatus(status Status, msg string) | ||
} | ||
|
||
// WithStatusReporter provides a method to set a status reporter | ||
type WithStatusReporter interface { | ||
// SetStatusReporter sets the status reporter | ||
SetStatusReporter(reporter StatusReporter) | ||
} |
7 changes: 4 additions & 3 deletions
7
libbeat/management/status_string.go → libbeat/management/status/status_string.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.