hostmap

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrackedMetrics map[string]struct{} = map[string]struct{}{
	// contains filtered or unexported fields
}

TrackedMetrics is the set of metrics that are tracked by the hostmap.

Functions

This section is empty.

Types

type HostMap

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

HostMap maps from hostnames to host metadata payloads.

func New

func New() *HostMap

New creates a new HostMap.

func (*HostMap) Flush

func (m *HostMap) Flush() map[string]payload.HostMetadata

Flush all the host metadata payloads and clear them from the HostMap.

func (*HostMap) Set added in v0.7.1

func (m *HostMap) Set(md payload.HostMetadata) error

Set a hardcoded host metadata payload.

func (*HostMap) Update

func (m *HostMap) Update(host string, res pcommon.Resource) (changed bool, md payload.HostMetadata, err error)

Update the information about a given host by providing a resource. The function reports:

  • Whether the information about the `host` has changed
  • The host metadata payload stored
  • Any non-fatal errors that may have occurred during the update

Non-fatal errors are local to the specific field where they happened and do not change the other fields. If when filling a field a non-fatal error is raised, the error will be reported, the field will be left empty and further fields will still be filled.

The order in which resource attributes are read does not affect the final host metadata payload, even if non-fatal errors are raised during execution.

func (*HostMap) UpdateFromMetric added in v0.11.0

func (m *HostMap) UpdateFromMetric(host string, metric pmetric.Metric)

Jump to

Keyboard shortcuts

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