status

package
v0.0.0-...-d00e9c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGlobalError

func AddGlobalError(key string, errorMessage string)

AddGlobalError an error message for the status display (errors will stop the agent)

func AddGlobalWarning

func AddGlobalWarning(key string, warning string)

AddGlobalWarning keeps track of a warning message to display on the status.

func Clear

func Clear()

Clear clears the status which means it needs to be initialized again to be used.

func Init

func Init(isRunning *atomic.Bool, endpoints *config.Endpoints, sources *sources.LogSources, tracker *tailers.TailerTracker, logExpVars *expvar.Map)

Init instantiates the builder that builds the status on the fly.

func RemoveGlobalWarning

func RemoveGlobalWarning(key string)

RemoveGlobalWarning loses track of a warning message that does not need to be displayed on the status anymore.

func SetCurrentTransport

func SetCurrentTransport(t Transport)

SetCurrentTransport sets the current transport used by the log agent.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is used to build the status.

func NewBuilder

func NewBuilder(isRunning *atomic.Bool, endpoints *config.Endpoints, sources *sourcesPkg.LogSources, tracker *tailers.TailerTracker, warnings *config.Messages, errors *config.Messages, logExpVars *expvar.Map) *Builder

NewBuilder returns a new builder.

func (*Builder) BuildStatus

func (b *Builder) BuildStatus(verbose bool) Status

BuildStatus returns the status of the logs-agent.

type Integration

type Integration struct {
	Name    string   `json:"name"`
	Sources []Source `json:"sources"`
}

Integration provides some information about a logs integration.

type Source

type Source struct {
	Type          string                 `json:"type"`
	Configuration map[string]interface{} `json:"configuration"`
	Status        string                 `json:"status"`
	Inputs        []string               `json:"inputs"`
	Messages      []string               `json:"messages"`
	Info          map[string][]string    `json:"info"`
}

Source provides some information about a logs source.

type Status

type Status struct {
	IsRunning        bool              `json:"is_running"`
	Endpoints        []string          `json:"endpoints"`
	StatusMetrics    map[string]string `json:"metrics"`
	ProcessFileStats map[string]uint64 `json:"process_file_stats"`
	Integrations     []Integration     `json:"integrations"`
	Tailers          []Tailer          `json:"tailers"`
	Errors           []string          `json:"errors"`
	Warnings         []string          `json:"warnings"`
	UseHTTP          bool              `json:"use_http"`
}

Status provides some information about logs-agent.

func Get

func Get(verbose bool) Status

Get returns the status of the logs-agent computed on the fly.

type Tailer

type Tailer struct {
	//nolint:revive // TODO(AML) Fix revive linter
	Id   string              `json:"id"`
	Type string              `json:"type"`
	Info map[string][]string `json:"info"`
}

type Transport added in v0.9.0

type Transport string

Transport is the transport used by logs-agent, i.e TCP or HTTP

const (
	// TransportHTTP indicates logs-agent is using HTTP transport
	TransportHTTP Transport = "HTTP"
	// TransportTCP indicates logs-agent is using TCP transport
	TransportTCP Transport = "TCP"
)

func GetCurrentTransport

func GetCurrentTransport() Transport

GetCurrentTransport returns the current transport used by the log agent.

Directories

Path Synopsis
module module
utils module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL